[Pkg-shadow-commits] r2034 - in upstream/trunk: . libmisc

nekral-guest at alioth.debian.org nekral-guest at alioth.debian.org
Sun May 25 23:22:16 UTC 2008


Author: nekral-guest
Date: 2008-05-25 23:22:15 +0000 (Sun, 25 May 2008)
New Revision: 2034

Modified:
   upstream/trunk/ChangeLog
   upstream/trunk/libmisc/valid.c
Log:
	* libmisc/valid.c: Avoid implicit conversion of pointers /chars to booleans.
	* libmisc/valid.c: Add brackets.


Modified: upstream/trunk/ChangeLog
===================================================================
--- upstream/trunk/ChangeLog	2008-05-25 23:01:14 UTC (rev 2033)
+++ upstream/trunk/ChangeLog	2008-05-25 23:22:15 UTC (rev 2034)
@@ -1,5 +1,11 @@
 2008-05-26  Nicolas François  <nicolas.francois at centraliens.net>
 
+	* libmisc/valid.c: Avoid implicit conversion of pointers /chars to
+	booleans.
+	* libmisc/valid.c: Add brackets.
+
+2008-05-26  Nicolas François  <nicolas.francois at centraliens.net>
+
 	* libmisc/yesno.c: yes_or_no returns a bool instead of int.
 	* libmisc/yesno.c: Avoid implicit conversion of pointers to
 	booleans.

Modified: upstream/trunk/libmisc/valid.c
===================================================================
--- upstream/trunk/libmisc/valid.c	2008-05-25 23:01:14 UTC (rev 2033)
+++ upstream/trunk/libmisc/valid.c	2008-05-25 23:22:15 UTC (rev 2034)
@@ -61,11 +61,12 @@
 	 * routine is meant to waste CPU time.
 	 */
 
-	if (ent->pw_name && !ent->pw_passwd[0]) {
-		if (!password[0])
+	if ((NULL != ent->pw_name) && ('\0' == ent->pw_passwd[0])) {
+		if ('\0' == password[0]) {
 			return (1);	/* user entered nothing */
-		else
+		} else {
 			return (0);	/* user entered something! */
+		}
 	}
 
 	/*
@@ -93,9 +94,11 @@
 	 * cause non-existent users to not be validated.
 	 */
 
-	if (ent->pw_name && strcmp (encrypted, ent->pw_passwd) == 0)
+	if ((NULL != ent->pw_name) &&
+	    (strcmp (encrypted, ent->pw_passwd) == 0)) {
 		return (1);
-	else
+	} else {
 		return (0);
+	}
 }
 




More information about the Pkg-shadow-commits mailing list