snprintf.c (236B)
1 #include <stdarg.h> 2 #include <stdio.h> 3 #undef snprintf 4 5 int 6 snprintf(char * restrict s, size_t siz, const char * restrict fmt, ...) 7 { 8 int r; 9 va_list va; 10 11 va_start(va, fmt); 12 r = vsnprintf(s, siz, fmt, va); 13 va_end(va); 14 15 return r; 16 }