]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/tls2.c
Silence warning in print_deref(): cast lutil_b64_ntop() arg to unsigned char*
[openldap] / libraries / libldap / tls2.c
index 69e6f609e84197420021f933f8d217553a11deda..3c440e9e518a3a9cc6e6c6bd958d62770b1af345 100644 (file)
@@ -434,11 +434,14 @@ ldap_pvt_tls_accept( Sockbuf *sb, void *ctx_arg )
 
        if ( err < 0 )
        {
-               char buf[256];
                if ( update_flags( sb, ssl, err )) return 1;
 
-               Debug( LDAP_DEBUG_ANY,"TLS: can't accept: %s.\n",
-                       tls_imp->ti_session_errmsg( err, buf, sizeof(buf) ),0,0 );
+               if ( DebugTest( LDAP_DEBUG_ANY ) ) {
+                       char buf[256], *msg;
+                       msg = tls_imp->ti_session_errmsg( err, buf, sizeof(buf) );
+                       Debug( LDAP_DEBUG_ANY,"TLS: can't accept: %s.\n",
+                               msg ? msg : "(unknown)", 0, 0 );
+               }
 
                ber_sockbuf_remove_io( sb, tls_imp->ti_sbio,
                        LBER_SBIOD_LEVEL_TRANSPORT );