From 02e98f106c72c398309b35151318a31557a67ee7 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Wed, 4 Nov 1998 23:25:56 +0000 Subject: [PATCH] Make sure vsnprintf() exists before using it. Add fallbacks. --- libraries/liblutil/setproctitle.c | 7 +++++++ 1 file changed, 7 insertions(+) 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); -- 2.39.5