]> granicus.if.org Git - shadow/commitdiff
* src/expiry.c: Ignore return value of setlocale(),
authornekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Mon, 9 Jun 2008 20:36:24 +0000 (20:36 +0000)
committernekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Mon, 9 Jun 2008 20:36:24 +0000 (20:36 +0000)
bindtextdomain(), and textdomain().
* src/expiry.c: Add brackets and parenthesis.
* src/expiry.c: Avoid assignments in comparisons.
* src/expiry.c: Avoid implicit conversion of pointers to booleans.

ChangeLog
src/expiry.c

index 4161c9b753a5f7ca0f2caa60d28c3c5d4fba4173..cdbdc9c9a043103054394c9208f261b0bbee199b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2008-06-09  Nicolas François  <nicolas.francois@centraliens.net>
+
+       * src/expiry.c: Ignore return value of setlocale(),
+       bindtextdomain(), and textdomain().
+       * src/expiry.c: Add brackets and parenthesis.
+       * src/expiry.c: Avoid assignments in comparisons.
+       * src/expiry.c: Avoid implicit conversion of pointers to booleans.
+
 2008-06-09  Nicolas François  <nicolas.francois@centraliens.net>
 
        * src/pwunconv.c: Use a bool when possible instead of int
index be5974a8786089cbcf11b6f7e89745ad66e585bc..ab4cb09516589a443e9d5f4803e38df6437c2bbf 100644 (file)
@@ -90,17 +90,21 @@ int main (int argc, char **argv)
         * expiry takes one of two arguments. The default action is to give
         * the usage message.
         */
-       setlocale (LC_ALL, "");
-       bindtextdomain (PACKAGE, LOCALEDIR);
-       textdomain (PACKAGE);
+       (void) setlocale (LC_ALL, "");
+       (void) bindtextdomain (PACKAGE, LOCALEDIR);
+       (void) textdomain (PACKAGE);
 
-       if (argc != 2 || (strcmp (argv[1], "-f") && strcmp (argv[1], "-c")))
+       if (   (argc != 2)
+           || (   (strcmp (argv[1], "-f") != 0)
+               && (strcmp (argv[1], "-c") != 0))) {
                usage ();
+       }
 
        /*
         * Get user entries for /etc/passwd and /etc/shadow
         */
-       if (!(pwd = get_my_pwent ())) {
+       pwd = get_my_pwent ();
+       if (NULL == pwd) {
                fprintf (stderr, _("%s: unknown user\n"), Prog);
                exit (10);
        }
@@ -142,3 +146,4 @@ int main (int argc, char **argv)
        usage ();
        exit (1);
 }
+