diff options
author | Rob Landley <rob@landley.net> | 2005-12-18 20:34:41 +0000 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2005-12-18 20:34:41 +0000 |
commit | 553d83d427741a13e7e66be0aa903c3edceb5823 (patch) | |
tree | 1281877b23198b187a609c8de5017b5f413103c1 /loginutils | |
parent | 9bdd742dd2f5fda08e6431ee58b15e1923fb3f64 (diff) | |
download | busybox-w32-553d83d427741a13e7e66be0aa903c3edceb5823.tar.gz busybox-w32-553d83d427741a13e7e66be0aa903c3edceb5823.tar.bz2 busybox-w32-553d83d427741a13e7e66be0aa903c3edceb5823.zip |
strncmp isn't automatically superior to strcmp. Especially when it isn't
used right.
Diffstat (limited to 'loginutils')
-rw-r--r-- | loginutils/vlock.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/loginutils/vlock.c b/loginutils/vlock.c index b66a3b1ae..b15b0ace0 100644 --- a/loginutils/vlock.c +++ b/loginutils/vlock.c | |||
@@ -101,7 +101,7 @@ extern int vlock_main(int argc, char **argv) | |||
101 | } | 101 | } |
102 | 102 | ||
103 | if (argc == 2) { | 103 | if (argc == 2) { |
104 | if (strncmp(argv[1], "-a", 2)) { | 104 | if (strcmp(argv[1], "-a")) { |
105 | bb_show_usage(); | 105 | bb_show_usage(); |
106 | } else { | 106 | } else { |
107 | o_lock_all = 1; | 107 | o_lock_all = 1; |
@@ -199,7 +199,7 @@ extern int vlock_main(int argc, char **argv) | |||
199 | } | 199 | } |
200 | 200 | ||
201 | crypt_pass = pw_encrypt(pass, pw->pw_passwd); | 201 | crypt_pass = pw_encrypt(pass, pw->pw_passwd); |
202 | if (strncmp(crypt_pass, pw->pw_passwd, sizeof(crypt_pass)) == 0) { | 202 | if (strcmp(crypt_pass, pw->pw_passwd) == 0) { |
203 | memset(pass, 0, strlen(pass)); | 203 | memset(pass, 0, strlen(pass)); |
204 | memset(crypt_pass, 0, strlen(crypt_pass)); | 204 | memset(crypt_pass, 0, strlen(crypt_pass)); |
205 | restore_terminal(); | 205 | restore_terminal(); |