X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=libraries%2Flibldap%2Fprint.c;h=02b95bcc05f98712db79f49754636c01f092042c;hb=55dba4395f81f75ad8f247d3c0fad7119fe1ea9d;hp=764f12850fafb9404b9a3aefea4e9a861a25c513;hpb=321354ecff5571b92cda1bf4b0299e33218d9be8;p=openldap diff --git a/libraries/libldap/print.c b/libraries/libldap/print.c index 764f12850f..02b95bcc05 100644 --- a/libraries/libldap/print.c +++ b/libraries/libldap/print.c @@ -1,5 +1,6 @@ +/* $OpenLDAP$ */ /* - * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved. + * Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved. * COPYING RESTRICTIONS APPLY, see COPYRIGHT file */ @@ -25,41 +26,23 @@ static int ldap_log_check( LDAP *ld, int loglvl ) if(ld == NULL) { errlvl = ldap_debug; } else { - errlvl = ld->ld_errno; + errlvl = ld->ld_debug; } return errlvl & loglvl ? 1 : 0; } -int ldap_log_printf -#ifdef HAVE_STDARG - ( LDAP *ld, int loglvl, char *fmt, ... ) -#else - ( va_alist ) -va_dcl -#endif +int ldap_log_printf( LDAP *ld, int loglvl, const char *fmt, ... ) { char buf[ 1024 ]; va_list ap; -#ifdef HAVE_STDARG - va_start( ap, fmt ); -#else - LD *ld - int loglvl; - char *fmt; - - va_start( ap ); - - errlvl = va_arg( ap, LD * ); - loglvl = va_arg( ap, int ); - fmt = va_arg( ap, char * ); -#endif - if ( !ldap_log_check( ld, loglvl )) { return 0; } + va_start( ap, fmt ); + #ifdef HAVE_VSNPRINTF buf[sizeof(buf) - 1] = '\0'; vsnprintf( buf, sizeof(buf)-1, fmt, ap ); @@ -72,16 +55,6 @@ va_dcl va_end(ap); - (*lber_pvt_log_print)( buf ); - return 1; -} - -static int lber_log_puts(int errlvl, int loglvl, char *buf) -{ - if ( !ldap_log_check( errlvl, loglvl )) { - return 0; - } - - (*lber_pvt_log_print)( buf ); + (*ber_pvt_log_print)( buf ); return 1; }