summaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
authorDenis Vlasenko2006-12-21 13:23:14 +0000
committerDenis Vlasenko2006-12-21 13:23:14 +0000
commitbf66fbc8e2380717c1fab860cfc60c78582839dd (patch)
tree3ab3dd4df901851ff7f4345708592118766ba4aa /libbb
parent6910741067913d131d931b1e6424d3b8ed43e64f (diff)
downloadbusybox-bf66fbc8e2380717c1fab860cfc60c78582839dd.zip
busybox-bf66fbc8e2380717c1fab860cfc60c78582839dd.tar.gz
introduce LONE_CHAR (optimized strcmp with one-char string)
Diffstat (limited to 'libbb')
-rw-r--r--libbb/correct_password.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/libbb/correct_password.c b/libbb/correct_password.c
index fd7e0b5..d031b21 100644
--- a/libbb/correct_password.c
+++ b/libbb/correct_password.c
@@ -40,15 +40,14 @@ int correct_password(const struct passwd *pw)
char *unencrypted, *encrypted, *correct;
#ifdef CONFIG_FEATURE_SHADOWPASSWDS
- if (!strcmp(pw->pw_passwd, "x") || !strcmp(pw->pw_passwd, "*")) {
+ if (LONE_CHAR(pw->pw_passwd, 'x') || LONE_CHAR(pw->pw_passwd, '*')) {
struct spwd *sp = getspnam(pw->pw_name);
if (!sp)
bb_error_msg_and_die("no valid shadow password");
correct = sp->sp_pwdp;
- }
- else
+ } else
#endif
correct = pw->pw_passwd;