Avoid assignments in comparisons.
This commit is contained in:
1 parent
ce4e74c1b9
commit
4c9686df0c
2 files changed
+6
-2
No files matched your search
@@ -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>
|
||||
|
||||
|
||||
+5
-2
@@ -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';
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user