X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=libraries%2Flibldap%2Fprint.c;h=02b95bcc05f98712db79f49754636c01f092042c;hb=55dba4395f81f75ad8f247d3c0fad7119fe1ea9d;hp=f8203c1604def10e36157f19abad00dd34caee2a;hpb=dc07e765f263ef459dcd2afd1ece01cfc85a0edd;p=openldap diff --git a/libraries/libldap/print.c b/libraries/libldap/print.c index f8203c1604..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, const 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 );