svn commit: trunk/busybox/loginutils
landley at busybox.net
landley at busybox.net
Sun Dec 18 20:34:43 UTC 2005
Author: landley
Date: 2005-12-18 12:34:41 -0800 (Sun, 18 Dec 2005)
New Revision: 12949
Log:
strncmp isn't automatically superior to strcmp. Especially when it isn't
used right.
Modified:
trunk/busybox/loginutils/vlock.c
Changeset:
Modified: trunk/busybox/loginutils/vlock.c
===================================================================
--- trunk/busybox/loginutils/vlock.c 2005-12-17 18:23:53 UTC (rev 12948)
+++ trunk/busybox/loginutils/vlock.c 2005-12-18 20:34:41 UTC (rev 12949)
@@ -101,7 +101,7 @@
}
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 @@
}
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();
More information about the busybox-cvs
mailing list