X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=libraries%2Flibldap%2Fprint.c;h=bbd21b36e1f99aba83939c6a559f37942db6fd9c;hb=3b9f4a82ee478c943a66696adf9133dc9f503e16;hp=ee021296fa374d8dc351ecd31e17bd2a1f629e48;hpb=ac687014ecaff498eca048c961241eac61cd47b4;p=openldap diff --git a/libraries/libldap/print.c b/libraries/libldap/print.c index ee021296fa..bbd21b36e1 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-2002 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 - LDAP *ld; - int loglvl; - char *fmt; - - va_start( ap ); - - ld = va_arg( ap, LDAP * ); - 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,6 +55,6 @@ va_dcl va_end(ap); - (*lber_pvt_log_print)( buf ); + (*ber_pvt_log_print)( buf ); return 1; }