]> git.sur5r.net Git - openldap/commitdiff
don't try to print NULLs on Solaris...
authorPierangelo Masarati <ando@openldap.org>
Fri, 19 Aug 2005 15:47:52 +0000 (15:47 +0000)
committerPierangelo Masarati <ando@openldap.org>
Fri, 19 Aug 2005 15:47:52 +0000 (15:47 +0000)
libraries/libldap/dntest.c

index 9e0abe37ee48c44b8da5074f292034b8a1c8e738..e99a0570c61926216117be556f33a4c58160e76c 100644 (file)
@@ -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 );