summaryrefslogtreecommitdiff
path: root/src/stdio/snprintf.c
blob: 44bb65fe8f0320e1781aca68f2ad49e9cf777a5c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <stdio.h>
#include <stdarg.h>
#include "_stdio.h"

int snprintf(char * restrict s, size_t n, const char * restrict format, ...)
{
	int ret = 0;
	va_list ap;
	struct io_options opt = {0};
	opt.fnname = __func__;
	opt.string = s;
	opt.maxlen = n;
	va_start(ap, format);
	ret = __printf(&opt, format, ap);
	va_end(ap);
	return ret;
}

/*
STDC(199901)
*/