]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/print.c
Add ber_bvstr and ber_bvstrdup string to berval allocators.
[openldap] / libraries / libldap / print.c
index 5254fea8db43c47b823e5ca6b351fc0c772aede2..a6616c53ecad68ce0b66fe8a60b5e5a04ea24c8d 100644 (file)
@@ -1,3 +1,4 @@
+/* $OpenLDAP$ */
 /*
  * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
@@ -31,35 +32,17 @@ static int ldap_log_check( LDAP *ld, int loglvl )
        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,6 +55,6 @@ va_dcl
 
        va_end(ap);
 
-       (*lber_pvt_log_print)( buf );
+       (*ber_pvt_log_print)( buf );
        return 1;
 }