projects
/
oweals
/
busybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9bdd742
)
strncmp isn't automatically superior to strcmp. Especially when it isn't
author
Rob Landley
<rob@landley.net>
Sun, 18 Dec 2005 20:34:41 +0000
(20:34 -0000)
committer
Rob Landley
<rob@landley.net>
Sun, 18 Dec 2005 20:34:41 +0000
(20:34 -0000)
used right.
loginutils/vlock.c
patch
|
blob
|
history
diff --git
a/loginutils/vlock.c
b/loginutils/vlock.c
index b66a3b1ae162ab4faa916412bd2e0e15336904b4..b15b0ace0ef4837aa76c41307376a95c65459a36 100644
(file)
--- a/
loginutils/vlock.c
+++ b/
loginutils/vlock.c
@@
-101,7
+101,7
@@
extern int vlock_main(int argc, char **argv)
}
if (argc == 2) {
- if (str
ncmp(argv[1], "-a", 2
)) {
+ if (str
cmp(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 (str
ncmp(crypt_pass, pw->pw_passwd, sizeof(crypt_pass)
) == 0) {
+ if (str
cmp(crypt_pass, pw->pw_passwd
) == 0) {
memset(pass, 0, strlen(pass));
memset(crypt_pass, 0, strlen(crypt_pass));
restore_terminal();