5 #include "choke-me: no vprintf and no snprintf"
8 #if defined(HAVE_STDARG_H)
11 # define VA_START(a, f) va_start(a, f)
12 # define VA_END(a) va_end(a)
13 # endif /* VA_START */
14 # define SNV_USING_STDARG_H
16 #elif defined(HAVE_VARARGS_H)
19 # define VA_START(a, f) va_start(a)
20 # define VA_END(a) va_end(a)
21 # endif /* VA_START */
22 # undef SNV_USING_STDARG_H
25 # include "must-have-stdarg-or-varargs"
29 snprintf(char *str
, size_t n
, char const *fmt
, ...)
34 #ifdef VSPRINTF_CHARSTAR
37 rp
= vsprintf(str
, fmt
, ap
);
43 rval
= vsprintf(str
, fmt
, ap
);
48 fprintf(stderr
, "snprintf buffer overrun %d > %d\n", rval
, (int)n
);
55 vsnprintf( char *str
, size_t n
, char const *fmt
, va_list ap
)
57 #ifdef VSPRINTF_CHARSTAR
58 return (strlen(vsprintf(str
, fmt
, ap
)));
60 return (vsprintf(str
, fmt
, ap
));