summaryrefslogtreecommitdiff
path: root/src/stdio/sprintf_s.c
blob: c103e179764742ee4b343d29f3ee158e0a3686b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <stdio.h>
#include <stdarg.h>

/** write formatted output to a string **/
int sprintf_s(char * restrict s, rsize_t n, const char * restrict format, ...)
{
	__C_EXT(1, 201112L);
        int retval;
        va_list ap;
        va_start(ap, format);
        retval = vsprintf(s, format, ap);
        va_end(ap);
        return retval;
}

/***
The fn(sprintf) function writes a formatted string to the buffer at arg(s). The
format of arg(format) and the variadic arguments is the same as that for
fn(printf).
***/

/* UNSPECIFIED: ??? */
/* UNDEFINED: ??? */
/* IMPLEMENTATION: ??? */
/* LOCALE: ??? */

/* RETURN: the number of characters written, not including the final char(\0) */

/*
CEXT1(201112)
*/