]> granicus.if.org Git - shadow/commitdiff
* src/faillog.c: Added splint annotations.
authornekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Thu, 23 Apr 2009 11:23:53 +0000 (11:23 +0000)
committernekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Thu, 23 Apr 2009 11:23:53 +0000 (11:23 +0000)
* 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.

ChangeLog
src/faillog.c

index ac97e930978129d19af30792adeca3a5e2b66355..7b160ec0b61fc29fc36cfdfeee601338cdfe1a20 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2009-04-22  Nicolas François  <nicolas.francois@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@centraliens.net>
 
        * src/grpck.c: Ignore puts return value.
index c2c516b291425ad95373cab17ab39699cf1ad91f..d6fa46006a2a2e17d6c9582928eeb56368880d47 100644 (file)
@@ -85,7 +85,7 @@ static void usage (void)
        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 @@ static void print_one (const struct passwd *pw, bool force)
                 */
                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 @@ static bool reset_one (uid_t uid)
                 */
                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 @@ static bool reset_one (uid_t uid)
        }
 
        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 @@ static bool setmax_one (uid_t uid, int max)
                 */
                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 @@ static bool setmax_one (uid_t uid, int max)
 
        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 @@ static bool set_locktime_one (uid_t uid, long locktime)
                 */
                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 @@ static bool set_locktime_one (uid_t uid, long locktime)
 
        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;
 }