From: Kurt Zeilenga Date: Wed, 4 Nov 1998 23:25:56 +0000 (+0000) Subject: Make sure vsnprintf() exists before using it. Add fallbacks. X-Git-Tag: OPENLDAP_SLAPD_BACK_LDAP~1210 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=02e98f106c72c398309b35151318a31557a67ee7;p=openldap Make sure vsnprintf() exists before using it. Add fallbacks. --- diff --git a/libraries/liblutil/setproctitle.c b/libraries/liblutil/setproctitle.c index 8c5ed0700c..b2a590b612 100644 --- a/libraries/liblutil/setproctitle.c +++ b/libraries/liblutil/setproctitle.c @@ -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);