summaryrefslogtreecommitdiff
path: root/src/stdio/snprintf.c
blob: acf234b117430a20aeae81665e1aaa9a16f8d6b3 (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 "nonstd/io.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)
*/