diff options
author | Jukka Jylänki <jujjyl@gmail.com> | 2014-05-20 12:15:27 +0300 |
---|---|---|
committer | Jukka Jylänki <jujjyl@gmail.com> | 2014-05-23 02:20:06 +0300 |
commit | c81baafb6a516c0bfef67751df1dcd19a0a9c750 (patch) | |
tree | 6dbd0d9a4dec7f7fc5ba27922a650c696a3c89bb /system/lib/libc/musl/src/stdio/snprintf.c | |
parent | 955e7442312dd16b627d375c3726fa580dcdd465 (diff) |
Migrate snprintf to musl. Move the most common sprintf-related code to libc instead of libcextra to avoid pulling libcextra in on common runs.
Diffstat (limited to 'system/lib/libc/musl/src/stdio/snprintf.c')
-rw-r--r-- | system/lib/libc/musl/src/stdio/snprintf.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/system/lib/libc/musl/src/stdio/snprintf.c b/system/lib/libc/musl/src/stdio/snprintf.c new file mode 100644 index 00000000..771503b2 --- /dev/null +++ b/system/lib/libc/musl/src/stdio/snprintf.c @@ -0,0 +1,13 @@ +#include <stdio.h> +#include <stdarg.h> + +int snprintf(char *restrict s, size_t n, const char *restrict fmt, ...) +{ + int ret; + va_list ap; + va_start(ap, fmt); + ret = vsnprintf(s, n, fmt, ap); + va_end(ap); + return ret; +} + |