]> git.sur5r.net Git - openldap/blobdiff - clients/tools/ldappasswd.c
example client using new logging
[openldap] / clients / tools / ldappasswd.c
index 365db634e8fe8beb82315acf79ca8ef615059849..b0cdfb6dea4f8d95883831cfb412320d78be8b8e 100644 (file)
@@ -481,7 +481,7 @@ main( int argc, char *argv[] )
 
 
                default:
-                       fprintf( stderr, "%s: unrecongized option -%c\n",
+                       fprintf( stderr, "%s: unrecognized option -%c\n",
                                prog, optopt );
                        usage (argv[0]);
                }
@@ -533,7 +533,9 @@ main( int argc, char *argv[] )
 
        if (want_bindpw && passwd.bv_val == NULL ) {
                /* handle bind password */
-               fprintf( stderr, "Bind DN: %s\n", binddn );
+               if( binddn != NULL ) {
+                       fprintf( stderr, "Bind DN: %s\n", binddn );
+               }
                passwd.bv_val = strdup( getpassphrase("Enter bind password: "));
                passwd.bv_len = passwd.bv_val ? strlen( passwd.bv_val ) : 0;
        }