From: Howard Chu Date: Mon, 17 Dec 2001 21:56:24 +0000 (+0000) Subject: Fix ITS#1497 use strcmp instead of strncmp X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~641 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=63d4d0eb1e09e858ed9932037e71ebb468e5e69b;p=openldap Fix ITS#1497 use strcmp instead of strncmp --- diff --git a/clients/tools/ldappasswd.c b/clients/tools/ldappasswd.c index f161ac79ad..7e61aebf09 100644 --- a/clients/tools/ldappasswd.c +++ b/clients/tools/ldappasswd.c @@ -510,7 +510,7 @@ main( int argc, char *argv[] ) ckoldpw = getpassphrase("Re-enter old password: "); if( oldpw== NULL || ckoldpw == NULL || - strncmp( oldpw, ckoldpw, strlen(oldpw) )) + strcmp( oldpw, ckoldpw )) { fprintf( stderr, "passwords do not match\n" ); return EXIT_FAILURE; @@ -524,7 +524,7 @@ main( int argc, char *argv[] ) cknewpw = getpassphrase("Re-enter new password: "); if( newpw== NULL || cknewpw == NULL || - strncmp( newpw, cknewpw, strlen(newpw) )) + strcmp( newpw, cknewpw )) { fprintf( stderr, "passwords do not match\n" ); return EXIT_FAILURE; diff --git a/servers/slapd/tools/slappasswd.c b/servers/slapd/tools/slappasswd.c index 98d859a32e..639b8a3f2d 100644 --- a/servers/slapd/tools/slappasswd.c +++ b/servers/slapd/tools/slappasswd.c @@ -97,7 +97,7 @@ main( int argc, char *argv[] ) newpw = strdup(getpassphrase("New password: ")); cknewpw = getpassphrase("Re-enter new password: "); - if( strncmp( newpw, cknewpw, strlen(newpw) )) { + if( strcmp( newpw, cknewpw )) { fprintf( stderr, "Password values do not match\n" ); return EXIT_FAILURE; }