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

This commit is contained in:
Kurt Zeilenga 1998-11-04 23:25:56 +00:00
parent 2f33278850
commit 02e98f106c

View File

@ -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);