]> git.sur5r.net Git - openldap/commitdiff
Make sure vsnprintf() exists before using it. Add fallbacks.
authorKurt Zeilenga <kurt@openldap.org>
Wed, 4 Nov 1998 23:25:56 +0000 (23:25 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Wed, 4 Nov 1998 23:25:56 +0000 (23:25 +0000)
libraries/liblutil/setproctitle.c

index 8c5ed0700c30d896ff7dc7a481b09d4f1802c7dc..b2a590b6121f9d9b83ae75c188ec9ac7bc619912 100644 (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);