From e223e635cc53fa11e473cdbc864eb69a3da5f290 Mon Sep 17 00:00:00 2001 From: Jakob Kaivo Date: Sun, 16 Aug 2020 15:55:19 -0400 Subject: add skeleton of symbols from C11 LIB_EXT1 --- src/stdio/sprintf_s.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 src/stdio/sprintf_s.c (limited to 'src/stdio/sprintf_s.c') diff --git a/src/stdio/sprintf_s.c b/src/stdio/sprintf_s.c new file mode 100644 index 00000000..223e84c8 --- /dev/null +++ b/src/stdio/sprintf_s.c @@ -0,0 +1,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) +*/ -- cgit v1.2.1