mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-04-12 15:10:31 +08:00
ITS#10105 liblber lutil_debug: ensure msg ends with NL
This commit is contained in:
parent
0537ec0ac9
commit
807a7cf720
@ -43,12 +43,15 @@ void (lutil_debug)( int debug, int level, const char *fmt, ... )
|
||||
{
|
||||
char buffer[4096];
|
||||
va_list vl;
|
||||
int len;
|
||||
|
||||
if ( !(level & debug ) ) return;
|
||||
|
||||
va_start( vl, fmt );
|
||||
vsnprintf( buffer, sizeof(buffer), fmt, vl );
|
||||
len = vsnprintf( buffer, sizeof(buffer), fmt, vl );
|
||||
va_end( vl );
|
||||
if ( len >= sizeof(buffer)-2 )
|
||||
buffer[sizeof(buffer)-2] = '\n';
|
||||
ber_pvt_log_print( buffer );
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user