]> git.sur5r.net Git - openldap/blobdiff - libraries/liblber/debug.c
ITS#2184 maxbuf tweaks from Larry Greenfield @ CMU
[openldap] / libraries / liblber / debug.c
index 044b9795a3eaab5adf25e09eb64c95f0fc97dd84..cfec0942e4a3f8f1df78f95fb7d286e8c5ecf60d 100644 (file)
@@ -30,7 +30,6 @@ struct DEBUGLEVEL
 };
 
 int ldap_loglevels[LDAP_SUBSYS_NUM];
-static long   numLevels = 0;
 
 static FILE *log_file = NULL;
 static int global_level = 0;
@@ -167,6 +166,7 @@ void lutil_log_int(
 #ifdef HAVE_VSYSLOG
                vsyslog( debug2syslog(level), fmt, vl );
 #else
+               char data[4096];
                vsnprintf( data, sizeof(data), fmt, vl );
                syslog( debug2syslog(level), data );
 #endif
@@ -310,11 +310,7 @@ void (lutil_debug)( int debug, int level, const char *fmt, ... )
 #endif
        va_start( vl, fmt );
 
-#ifdef HAVE_VSNPRINTF
        vsnprintf( buffer, sizeof(buffer), fmt, vl );
-#else
-       vsprintf( buffer, fmt, vl );
-#endif
        buffer[sizeof(buffer)-1] = '\0';
 
        if( log_file != NULL ) {