[Pkg-shadow-commits] r2174 - in upstream/trunk: . lib

nekral-guest at alioth.debian.org nekral-guest at alioth.debian.org
Fri Jun 13 21:55:52 UTC 2008


Author: nekral-guest
Date: 2008-06-13 21:55:51 +0000 (Fri, 13 Jun 2008)
New Revision: 2174

Modified:
   upstream/trunk/ChangeLog
   upstream/trunk/lib/shadow.c
Log:
	* lib/shadow.c: Use SHADOW_SP_FLAG_UNSET for the initial
	value of spwd.sp_flag.
	* lib/shadow.c: Add brackets.
	* lib/shadow.c: Avoid implicit conversion of pointers to
	booleans.
	* lib/shadow.c: The size argument of fgets is an int, not a
	size_t.


Modified: upstream/trunk/ChangeLog
===================================================================
--- upstream/trunk/ChangeLog	2008-06-13 21:53:41 UTC (rev 2173)
+++ upstream/trunk/ChangeLog	2008-06-13 21:55:51 UTC (rev 2174)
@@ -1,5 +1,15 @@
 2008-06-13  Nicolas François  <nicolas.francois at centraliens.net>
 
+	* lib/shadow.c: Use SHADOW_SP_FLAG_UNSET for the initial
+	value of spwd.sp_flag.
+	* lib/shadow.c: Add brackets.
+	* lib/shadow.c: Avoid implicit conversion of pointers to
+	booleans.
+	* lib/shadow.c: The size argument of fgets is an int, not a
+	size_t.
+
+2008-06-13  Nicolas François  <nicolas.francois at centraliens.net>
+
 	* lib/commonio.c: len should be typed ssize_t as it is the return
 	of read(), and is compared to 0. Cast to size_t when necessary.
 

Modified: upstream/trunk/lib/shadow.c
===================================================================
--- upstream/trunk/lib/shadow.c	2008-06-13 21:53:41 UTC (rev 2173)
+++ upstream/trunk/lib/shadow.c	2008-06-13 21:55:51 UTC (rev 2174)
@@ -236,7 +236,7 @@
 
 	if (i == OFIELDS) {
 		spwd.sp_warn = spwd.sp_inact = spwd.sp_expire =
-		    spwd.sp_flag = -1;
+		    spwd.sp_flag = SHADOW_SP_FLAG_UNSET;
 
 		return &spwd;
 	}
@@ -291,8 +291,9 @@
 #else
 		return 0;
 #endif
-	} else if (fields[7][0] == '\0')
+	} else if (fields[7][0] == '\0') {
 		spwd.sp_expire = -1;
+	}
 
 	/*
 	 * This field is reserved for future use.  But it isn't supposed
@@ -302,15 +303,17 @@
 	spwd.sp_flag = strtol (fields[8], &cpp, 10);
 	if ((spwd.sp_flag == 0) && *cpp) {
 #ifdef	USE_NIS
-		if (!nis_used)
+		if (!nis_used) {
 			return 0;
-		else
-			spwd.sp_flag = -1;
+		} else {
+			spwd.sp_flag = SHADOW_SP_FLAG_UNSET;
+		}
 #else
 		return 0;
 #endif
-	} else if (fields[8][0] == '\0')
-		spwd.sp_flag = -1;
+	} else if (fields[8][0] == '\0') {
+		spwd.sp_flag = SHADOW_SP_FLAG_UNSET;
+	}
 
 	return (&spwd);
 }
@@ -324,21 +327,24 @@
 	char buf[BUFSIZ];
 	char *cp;
 
-	if (!fp)
+	if (NULL == fp) {
 		return (0);
+	}
 
 #ifdef	USE_NIS
-	while (fgets (buf, sizeof buf, fp) != (char *) 0)
+	while (fgets (buf, (int) sizeof buf, fp) != (char *) 0)
 #else
-	if (fgets (buf, sizeof buf, fp) != (char *) 0)
+	if (fgets (buf, (int) sizeof buf, fp) != (char *) 0)
 #endif
 	{
 		cp = strchr (buf, '\n');
-		if (NULL != cp)
+		if (NULL != cp) {
 			*cp = '\0';
+		}
 #ifdef	USE_NIS
-		if (nis_ignore && IS_NISCHAR (buf[0]))
+		if (nis_ignore && IS_NISCHAR (buf[0])) {
 			continue;
+		}
 #endif
 		return my_sgetspent (buf);
 	}




More information about the Pkg-shadow-commits mailing list