From: Jim Meyering Date: Tue, 1 Jun 2004 13:04:02 +0000 (+0000) Subject: (correct_password, restricted_shell, main): X-Git-Tag: v5.3.0~1442 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ae752755d24ab10b8861dbf25a1d3d7c6b9499b6;p=thirdparty%2Fcoreutils.git (correct_password, restricted_shell, main): Prefer the notation `STREQ (a, b)' over `strcmp (a, b) == 0'. --- diff --git a/src/su.c b/src/su.c index d15d96a935..b91b8d3799 100644 --- a/src/su.c +++ b/src/su.c @@ -293,7 +293,7 @@ correct_password (const struct passwd *pw) } encrypted = crypt (unencrypted, correct); memset (unencrypted, 0, strlen (unencrypted)); - return strcmp (encrypted, correct) == 0; + return STREQ (encrypted, correct); } /* Update `environ' for the new shell based on PW, with SHELL being @@ -415,7 +415,7 @@ restricted_shell (const char *shell) setusershell (); while ((line = getusershell ()) != NULL) { - if (*line != '#' && strcmp (line, shell) == 0) + if (*line != '#' && STREQ (line, shell)) { endusershell (); return 0; @@ -516,7 +516,7 @@ main (int argc, char **argv) } } - if (optind < argc && !strcmp (argv[optind], "-")) + if (optind < argc && STREQ (argv[optind], "-")) { simulate_login = 1; ++optind;