]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(correct_password, restricted_shell, main):
authorJim Meyering <jim@meyering.net>
Tue, 1 Jun 2004 13:04:02 +0000 (13:04 +0000)
committerJim Meyering <jim@meyering.net>
Tue, 1 Jun 2004 13:04:02 +0000 (13:04 +0000)
Prefer the notation `STREQ (a, b)' over `strcmp (a, b) == 0'.

src/su.c

index d15d96a935a0b87c71eed888a2946da2c3326df1..b91b8d3799b32aa454c41fcab6c7a8199556dfdb 100644 (file)
--- 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;