]> granicus.if.org Git - shadow/commitdiff
Avoid assignments in comparisons.
authornekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Mon, 31 Dec 2007 15:30:29 +0000 (15:30 +0000)
committernekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Mon, 31 Dec 2007 15:30:29 +0000 (15:30 +0000)
ChangeLog
src/chsh.c

index b0556a713ee149ff8919610d80fc455701a150b3..f2196f2cdb1baed6e79c6cc93482ff497abd36b5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,7 @@
        * src/chsh.c: Before pam_end(), the return value of the previous
        pam API was already checked. No need to validate it again.
        * src/chsh.c: Avoid implicit brackets.
+       * src/chsh.c: Avoid assignments in comparisons.
 
 2007-12-31  Nicolas François  <nicolas.francois@centraliens.net>
 
index 1bb97cbf35ad89ba685810ab8e9265a66bea466f..f120b53b8021b04823356068c5ba1f29dc48d06a 100644 (file)
@@ -153,11 +153,14 @@ static int check_shell (const char *sh)
        }
        endusershell ();
 #else
-       if ((fp = fopen (SHELLS_FILE, "r")) == (FILE *) 0)
+       fp = fopen (SHELLS_FILE, "r");
+       if (NULL == fp) {
                return 0;
+       }
 
        while (fgets (buf, sizeof (buf), fp)) {
-               if ((cp = strrchr (buf, '\n'))) {
+               cp = strrchr (buf, '\n');
+               if (NULL != cp) {
                        *cp = '\0';
                }