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

Nicolas FRANÇOIS nekral-guest at alioth.debian.org
Thu Apr 23 11:23:53 UTC 2009


Author: nekral-guest
Date: 2009-04-23 11:23:53 +0000 (Thu, 23 Apr 2009)
New Revision: 2770

Modified:
   upstream/trunk/ChangeLog
   upstream/trunk/src/faillog.c
Log:
	* src/faillog.c: Added splint annotations.
	* src/faillog.c: Cast ID to ulongs and use ulong formats for IDs.
	* src/faillog.c: Ignore fflush() return value.
	* src/faillog.c: Added parenthesis.


Modified: upstream/trunk/ChangeLog
===================================================================
--- upstream/trunk/ChangeLog	2009-04-23 11:21:57 UTC (rev 2769)
+++ upstream/trunk/ChangeLog	2009-04-23 11:23:53 UTC (rev 2770)
@@ -1,5 +1,12 @@
 2009-04-22  Nicolas François  <nicolas.francois at centraliens.net>
 
+	* src/faillog.c: Added splint annotations.
+	* src/faillog.c: Cast ID to ulongs and use ulong formats for IDs.
+	* src/faillog.c: Ignore fflush() return value.
+	* src/faillog.c: Added parenthesis.
+
+2009-04-22  Nicolas François  <nicolas.francois at centraliens.net>
+
 	* src/grpck.c: Ignore puts return value.
 	* src/grpck.c: Avoid variable format string.
 

Modified: upstream/trunk/src/faillog.c
===================================================================
--- upstream/trunk/src/faillog.c	2009-04-23 11:21:57 UTC (rev 2769)
+++ upstream/trunk/src/faillog.c	2009-04-23 11:23:53 UTC (rev 2770)
@@ -85,7 +85,7 @@
 	exit (E_USAGE);
 }
 
-static void print_one (const struct passwd *pw, bool force)
+static void print_one (/*@null@*/const struct passwd *pw, bool force)
 {
 	static bool once = false;
 	struct tm *tm;
@@ -112,8 +112,8 @@
 		 */
 		if (fread ((char *) &fl, sizeof (fl), 1, fail) != 1) {
 			fprintf (stderr,
-			         _("faillog: Failed to get the entry for UID %d\n"),
-			         pw->pw_uid);
+			         _("faillog: Failed to get the entry for UID %lu\n"),
+			         (unsigned long int)pw->pw_uid);
 			return;
 		}
 	} else {
@@ -211,8 +211,8 @@
 		 */
 		if (fread ((char *) &fl, sizeof (fl), 1, fail) != 1) {
 			fprintf (stderr,
-			         _("faillog: Failed to get the entry for UID %d\n"),
-			         uid);
+			         _("faillog: Failed to get the entry for UID %lu\n"),
+			         (unsigned long int)uid);
 			return true;
 		}
 	} else {
@@ -241,8 +241,8 @@
 	}
 
 	fprintf (stderr,
-	         _("faillog: Failed to reset fail count for UID %d\n"),
-	         uid);
+	         _("faillog: Failed to reset fail count for UID %lu\n"),
+	         (unsigned long int)uid);
 	return true;
 }
 
@@ -297,8 +297,8 @@
 		 */
 		if (fread ((char *) &fl, sizeof (fl), 1, fail) != 1) {
 			fprintf (stderr,
-			         _("faillog: Failed to get the entry for UID %d\n"),
-			         uid);
+			         _("faillog: Failed to get the entry for UID %lu\n"),
+			         (unsigned long int)uid);
 			return true;
 		}
 	} else {
@@ -323,13 +323,13 @@
 
 	if (   (fseeko (fail, offset, SEEK_SET) == 0)
 	    && (fwrite ((char *) &fl, sizeof (fl), 1, fail) == 1)) {
-		fflush (fail);
+		(void) fflush (fail);
 		return false;
 	}
 
 	fprintf (stderr,
-	         _("faillog: Failed to set max for UID %d\n"),
-	         uid);
+	         _("faillog: Failed to set max for UID %lu\n"),
+	         (unsigned long int)uid);
 	return true;
 }
 
@@ -387,8 +387,8 @@
 		 */
 		if (fread ((char *) &fl, sizeof (fl), 1, fail) != 1) {
 			fprintf (stderr,
-			         _("faillog: Failed to get the entry for UID %d\n"),
-			         uid);
+			         _("faillog: Failed to get the entry for UID %lu\n"),
+			         (unsigned long int)uid);
 			return true;
 		}
 	} else {
@@ -411,15 +411,15 @@
 
 	fl.fail_locktime = locktime;
 
-	if (fseeko (fail, offset, SEEK_SET) == 0
-	    && fwrite ((char *) &fl, sizeof (fl), 1, fail) == 1) {
-		fflush (fail);
+	if (   (fseeko (fail, offset, SEEK_SET) == 0)
+	    && (fwrite ((char *) &fl, sizeof (fl), 1, fail) == 1)) {
+		(void) fflush (fail);
 		return false;
 	}
 
 	fprintf (stderr,
-	         _("faillog: Failed to set locktime for UID %d\n"),
-	         uid);
+	         _("faillog: Failed to set locktime for UID %lu\n"),
+	         (unsigned long int)uid);
 	return true;
 }
 




More information about the Pkg-shadow-commits mailing list