Skip to content
Snippets Groups Projects
Commit 02e98f10 authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

Make sure vsnprintf() exists before using it. Add fallbacks.

parent 2f332788
No related branches found
No related tags found
No related merge requests found
......@@ -54,8 +54,15 @@ va_dcl
va_start(ap);
#endif
#ifdef HAVE_VSNPRINTF
buf[sizeof(buf) - 1] = '\0';
vsnprintf( buf, sizeof(buf)-1, fmt, ap );
#elif HAVE_VPRINTF
vsprintf( buf, fmt, ap ); /* hope it's not too long */
#else
/* use doprnt() */
chokeme = "choke me! I don't have a doprnt() manual handy";
#endif
va_end(ap);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment