mirror of
https://git.openldap.org/openldap/openldap.git
synced 2024-12-15 03:01:09 +08:00
Make sure vsnprintf() exists before using it. Add fallbacks.
This commit is contained in:
parent
2f33278850
commit
02e98f106c
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user