diff options
Diffstat (limited to 'src/user/lib/printf.c')
-rw-r--r-- | src/user/lib/printf.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/user/lib/printf.c b/src/user/lib/printf.c index cb6561b..a2f21d8 100644 --- a/src/user/lib/printf.c +++ b/src/user/lib/printf.c @@ -31,6 +31,15 @@ int fprintf(FILE *restrict f, const char *restrict fmt, ...) { return ret; } +int sprintf(char *restrict s, const char *restrict fmt, ...) { + int ret; + va_list argp; + va_start(argp, fmt); + ret = vsnprintf(s, ~0, fmt, argp); + va_end(argp); + return ret; +} + int vprintf(const char *restrict fmt, va_list ap) { return vfprintf(stdout, fmt, ap); } |