mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-01-20 22:03:45 -05:00
ITS#10105 liblber lutil_debug: ensure msg ends with NL
This commit is contained in:
parent
38791abdc9
commit
5c7b096b3c
1 changed files with 4 additions and 1 deletions
|
|
@ -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…
Reference in a new issue