X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=libraries%2Flibldap%2Fdntest.c;h=9c53ce92166d8925b74554d645e607d82affbd65;hb=de01a6e3d791d3458549d2ceeccf4d7e0477ff78;hp=a3696c20284597ed436f350a85094bb4b615d9ab;hpb=3c598e89fb34a892d369a138daa8c3314294493c;p=openldap diff --git a/libraries/libldap/dntest.c b/libraries/libldap/dntest.c index a3696c2028..9c53ce9216 100644 --- a/libraries/libldap/dntest.c +++ b/libraries/libldap/dntest.c @@ -2,7 +2,7 @@ /* $OpenLDAP$ */ /* This work is part of OpenLDAP Software . * - * Copyright 1998-2004 The OpenLDAP Foundation. + * Copyright 1998-2007 The OpenLDAP Foundation. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -171,31 +171,32 @@ main( int argc, char *argv[] ) case LDAP_DN_FORMAT_LDAPV3: case LDAP_DN_FORMAT_LDAPV2: n = ldap_dn2domain( strin, &tmp ); - if( n ) { + if ( n ) { fprintf( stdout, "\nldap_dn2domain(\"%s\") FAILED\n", strin ); } else { fprintf( stdout, "\nldap_dn2domain(\"%s\")\n" - "\t= \"%s\"\n", strin, tmp ); + "\t= \"%s\"\n", strin, tmp ? tmp : "" ); } ldap_memfree( tmp ); tmp = ldap_dn2ufn( strin ); fprintf( stdout, "\nldap_dn2ufn(\"%s\")\n" - "\t= \"%s\"\n", strin, tmp ); + "\t= \"%s\"\n", strin, tmp ? tmp : "" ); ldap_memfree( tmp ); tmp = ldap_dn2dcedn( strin ); fprintf( stdout, "\nldap_dn2dcedn(\"%s\")\n" - "\t= \"%s\"\n", strin, tmp ); + "\t= \"%s\"\n", strin, tmp ? tmp : "" ); tmp2 = ldap_dcedn2dn( tmp ); fprintf( stdout, "\nldap_dcedn2dn(\"%s\")\n" - "\t= \"%s\"\n", tmp, tmp2 ); + "\t= \"%s\"\n", + tmp ? tmp : "", tmp2 ? tmp2 : "" ); ldap_memfree( tmp ); ldap_memfree( tmp2 ); tmp = ldap_dn2ad_canonical( strin ); fprintf( stdout, "\nldap_dn2ad_canonical(\"%s\")\n" - "\t= \"%s\"\n", strin, tmp ); + "\t= \"%s\"\n", strin, tmp ? tmp : "" ); ldap_memfree( tmp ); fprintf( stdout, "\nldap_explode_dn(\"%s\"):\n", str );