aboutsummaryrefslogtreecommitdiff
path: root/loginutils
diff options
context:
space:
mode:
authorGravatar Rob Landley <rob@landley.net>2005-12-18 20:34:41 +0000
committerGravatar Rob Landley <rob@landley.net>2005-12-18 20:34:41 +0000
commit553d83d427741a13e7e66be0aa903c3edceb5823 (patch)
tree1281877b23198b187a609c8de5017b5f413103c1 /loginutils
parent9bdd742dd2f5fda08e6431ee58b15e1923fb3f64 (diff)
downloadbusybox-553d83d427741a13e7e66be0aa903c3edceb5823.tar.gz
busybox-553d83d427741a13e7e66be0aa903c3edceb5823.tar.bz2
strncmp isn't automatically superior to strcmp. Especially when it isn't
used right.
Diffstat (limited to 'loginutils')
-rw-r--r--loginutils/vlock.c4
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)
}
if (argc == 2) {
- if (strncmp(argv[1], "-a", 2)) {
+ if (strcmp(argv[1], "-a")) {
bb_show_usage();
} else {
o_lock_all = 1;
@@ -199,7 +199,7 @@ extern int vlock_main(int argc, char **argv)
}
crypt_pass = pw_encrypt(pass, pw->pw_passwd);
- if (strncmp(crypt_pass, pw->pw_passwd, sizeof(crypt_pass)) == 0) {
+ if (strcmp(crypt_pass, pw->pw_passwd) == 0) {
memset(pass, 0, strlen(pass));
memset(crypt_pass, 0, strlen(crypt_pass));
restore_terminal();