[Pkg-shadow-commits] r1580 - in upstream/trunk: . src

nekral-guest at alioth.debian.org nekral-guest at alioth.debian.org
Mon Dec 31 15:30:30 UTC 2007


Author: nekral-guest
Date: 2007-12-31 15:30:29 +0000 (Mon, 31 Dec 2007)
New Revision: 1580

Modified:
   upstream/trunk/ChangeLog
   upstream/trunk/src/chsh.c
Log:
Avoid assignments in comparisons.


Modified: upstream/trunk/ChangeLog
===================================================================
--- upstream/trunk/ChangeLog	2007-12-31 15:27:23 UTC (rev 1579)
+++ upstream/trunk/ChangeLog	2007-12-31 15:30:29 UTC (rev 1580)
@@ -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 at centraliens.net>
 

Modified: upstream/trunk/src/chsh.c
===================================================================
--- upstream/trunk/src/chsh.c	2007-12-31 15:27:23 UTC (rev 1579)
+++ upstream/trunk/src/chsh.c	2007-12-31 15:30:29 UTC (rev 1580)
@@ -153,11 +153,14 @@
 	}
 	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';
 		}
 




More information about the Pkg-shadow-commits mailing list