]> granicus.if.org Git - shadow/commitdiff
* src/userdel.c, src/lastlog.c, src/gpasswd.c, src/newusers.c,
authornekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Sat, 5 Sep 2009 22:31:29 +0000 (22:31 +0000)
committernekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Sat, 5 Sep 2009 22:31:29 +0000 (22:31 +0000)
src/chpasswd.c, src/groupmems.c, src/usermod.c, src/chgpasswd.c,
src/vipw.c, src/su.c, src/useradd.c, src/groupmod.c, src/passwd.c,
src/groupadd.c, src/chage.c, src/faillog.c, src/chsh.c: Use
booleans for tests.
* src/userdel.c, src/gpasswd.c, src/groupmems.c, src/usermod.c,
src/groupmod.c, src/passwd.c: Use a break even after usage().

18 files changed:
ChangeLog
src/chage.c
src/chgpasswd.c
src/chpasswd.c
src/chsh.c
src/faillog.c
src/gpasswd.c
src/groupadd.c
src/groupmems.c
src/groupmod.c
src/lastlog.c
src/newusers.c
src/passwd.c
src/su.c
src/useradd.c
src/userdel.c
src/usermod.c
src/vipw.c

index 0910d8d6c62d738ae06c64b91b8e769bec43215c..3cec6d0abe79a6e23da3de749deb4663a05ba9db 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2009-09-06  Nicolas François  <nicolas.francois@centraliens.net>
+
+       * src/userdel.c, src/lastlog.c, src/gpasswd.c, src/newusers.c,
+       src/chpasswd.c, src/groupmems.c, src/usermod.c, src/chgpasswd.c,
+       src/vipw.c, src/su.c, src/useradd.c, src/groupmod.c, src/passwd.c,
+       src/groupadd.c, src/chage.c, src/faillog.c, src/chsh.c: Use
+       booleans for tests.
+       * src/userdel.c, src/gpasswd.c, src/groupmems.c, src/usermod.c,
+       src/groupmod.c, src/passwd.c: Use a break even after usage().
+
 2009-09-05  Nicolas François  <nicolas.francois@centraliens.net>
 
        * src/gpasswd.c, src/groupmems.c: Split the groupmems and gpasswd
index ebd3c2532a1c3cf31d1f6d2f8ec923ea60343463..f8b27b05f21abff8f2410d75d4590a1430fb57ba 100644 (file)
@@ -168,7 +168,7 @@ static void usage (int status)
                 "  -M, --maxdays MAX_DAYS        set maximim number of days before password\n"
                 "                                change to MAX_DAYS\n"
                 "  -W, --warndays WARN_DAYS      set expiration warning days to WARN_DAYS\n"
-                "\n"), status ? stderr : stdout);
+                "\n"), (E_SUCCESS != status) ? stderr : stdout);
        exit (status);
 }
 
index 581e96bd199d42100283973fe86266dbf26663cc..da4560effbc3f79876dca0fa5e162dad2ea9f2f1 100644 (file)
@@ -116,7 +116,7 @@ static void fail_exit (int code)
  */
 static void usage (int status)
 {
-       fprintf (status ? stderr : stdout,
+       (void) fprintf ((E_SUCCESS != status) ? stderr : stdout,
                         _("Usage: %s [options]\n"
                           "\n"
                           "Options:\n"
index b8922915b4e97d967b2b5a96e05e5a6d87738e4f..63158d1e1341521bf791bdc54a44f4ef6254f399 100644 (file)
@@ -114,7 +114,7 @@ static void fail_exit (int code)
  */
 static void usage (int status)
 {
-       FILE *usageout = status ? stderr : stdout;
+       FILE *usageout = (E_SUCCESS != status) ? stderr : stdout;
        (void) fprintf (usageout,
                        _("Usage: %s [options]\n"
                          "\n"
index 5a98234be79bcd118c98b31e275f7a822288e803..c0dc948c73b5d996ff9664fce8aa79d4ff61add6 100644 (file)
@@ -108,7 +108,7 @@ static void usage (int status)
                 "Options:\n"
                 "  -h, --help                    display this help message and exit\n"
                 "  -s, --shell SHELL             new login shell for the user account\n"
-                "\n"), status ? stderr : stdout);
+                "\n"), (E_SUCCESS != status) ? stderr : stdout);
        exit (status);
 }
 
index 47e9b3d773fde9573b30c2d4f1c2de0cad24d62b..abd4a9ff4f635fd53361b9ae9126efc2f1d4ddaa 100644 (file)
@@ -82,7 +82,7 @@ static struct stat statbuf;   /* fstat buffer for file size */
 
 static void usage (int status)
 {
-       FILE *usageout = status ? stderr : stdout;
+       FILE *usageout = (E_SUCCESS != status) ? stderr : stdout;
        (void) fprintf (usageout,
                        _("Usage: %s [options]\n"
                          "\n"
index d3682bd2eb8fd0b2209edcb3abd4abbda1322075..9c6ca6a2294372b1bf874b68fe2b6a7a86f1cf2b 100644 (file)
@@ -130,7 +130,7 @@ static void log_gpasswd_success_gshadow (unused void *arg);
  */
 static void usage (int status)
 {
-       FILE *usageout = status ? stderr : stdout;
+       FILE *usageout = (E_SUCCESS != status) ? stderr : stdout;
        (void) fprintf (usageout,
                        _("Usage: %s [option] GROUP\n"
                          "\n"
@@ -278,6 +278,7 @@ static void process_flags (int argc, char **argv)
                        break;
                case 'h':
                        usage (E_SUCCESS);
+                       break;
                case 'M':       /* set the list of members */
                        members = optarg;
                        if (!is_valid_user_list (members)) {
index 1a0f7cba60d61320bcc096a58133b544d3d3f4f7..35b1da18c264d1d598e095c31a03cbe87073499f 100644 (file)
@@ -107,7 +107,7 @@ static void check_perms (void);
  */
 static void usage (int status)
 {
-       FILE *usageout = status ? stderr : stdout;
+       FILE *usageout = (E_SUCCESS != status) ? stderr : stdout;
        (void) fprintf (usageout,
                        _("Usage: %s [options] GROUP\n"
                          "\n"
index 91e89a5da04f3aad47107f880ac300e021868d31..8202cf90c30991328b8364131183cab5421e047e 100644 (file)
@@ -363,7 +363,7 @@ static void display_members (const char *const *members)
 
 static void usage (int status)
 {
-       FILE *usageout = status ? stderr : stdout;
+       FILE *usageout = (EXIT_SUCCESS != status) ? stderr : stdout;
        (void) fprintf (usageout,
                        _("Usage: %s [options] [action]\n"
                          "\n"
@@ -414,6 +414,7 @@ static void process_flags (int argc, char **argv)
                        break;
                case 'h':
                        usage (EXIT_SUCCESS);
+                       break;
                case 'l':
                        list = true;
                        ++exclusive;
index 1951ec30c0a3f0e2e3bab0121d22323f61ddbc2e..4205df205dc081264347b0730d94ccc7f56c9c93 100644 (file)
@@ -115,7 +115,7 @@ static void update_primary_groups (gid_t ogid, gid_t ngid);
 
 static void usage (int status)
 {
-       FILE *usageout = status ? stderr : stdout;
+       FILE *usageout = (E_SUCCESS != status) ? stderr : stdout;
        (void) fprintf (usageout,
                        _("Usage: %s [options] GROUP\n"
                          "\n"
@@ -365,6 +365,7 @@ static void process_flags (int argc, char **argv)
                        break;
                case 'h':
                        usage (E_SUCCESS);
+                       break;
                case 'n':
                        nflg = true;
                        group_newname = optarg;
index 173b6548bc0f7e788697ddd43b7b5456961c9992..43008c75c769868473929a97e643ae504c383a8f 100644 (file)
@@ -80,7 +80,7 @@ static void usage (int status)
                 "  -h, --help                    display this help message and exit\n"
                 "  -t, --time DAYS               print only lastlog records more recent than DAYS\n"
                 "  -u, --user LOGIN              print lastlog record of the specified LOGIN\n"
-                "\n"), status ? stderr : stdout);
+                "\n"), (EXIT_SUCCESS != status) ? stderr : stdout);
        exit (status);
 }
 
index ce3564a6edff32d2956a2f02189ab577308d91af..a7793ab3903a9f66c4d4c20bbc1d7f890c0a053a 100644 (file)
@@ -112,7 +112,7 @@ static void close_files (void);
  */
 static void usage (int status)
 {
-       FILE *usageout = status ? stderr : stdout;
+       FILE *usageout = (EXIT_SUCCESS != status) ? stderr : stdout;
        (void) fprintf (usageout,
                        _("Usage: %s [options]\n"
                          "\n"
index a2e367f75f1ef7fc3ea78d35cfbc882fc23ca86a..8e65b6742c0c4aa479e86cfcfa307ec075345b4d 100644 (file)
@@ -180,7 +180,7 @@ static void usage (int status)
                 "  -w, --warndays WARN_DAYS      set expiration warning days to WARN_DAYS\n"
                 "  -x, --maxdays MAX_DAYS        set maximum number of days before password\n"
                 "                                change to MAX_DAYS\n"
-                "\n"), status ? stderr : stdout);
+                "\n"), (E_SUCCESS != status) ? stderr : stdout);
        exit (status);
 }
 
@@ -899,6 +899,7 @@ int main (int argc, char **argv)
                                break;
                        case 'h':
                                usage (E_SUCCESS);
+                               break;
                        default:
                                usage (E_BAD_ARG);
                        }
index 29f8317ffbed7dc686d40ac9fa96ed8479032385..716cbf637761dc37f7e9bc9fdbf3707e47d3d6be 100644 (file)
--- a/src/su.c
+++ b/src/su.c
@@ -335,7 +335,7 @@ static void usage (int status)
                 "  --preserve-environment        do not reset environment variables, and\n"
                 "                                keep the same shell\n"
                 "  -s, --shell SHELL             use SHELL instead of the default in passwd\n"
-                "\n"), status ? stderr : stdout);
+                "\n"), (E_SUCCESS != status) ? stderr : stdout);
        exit (status);
 }
 
index ec820af665a55c81344b418939cb46a51c241f65..e189d2f4d3a0da82416bc07e9f88be3fc35e49d8 100644 (file)
@@ -683,7 +683,7 @@ static int get_groups (char *list)
  */
 static void usage (int status)
 {
-       FILE *usageout = status ? stderr : stdout;
+       FILE *usageout = (E_SUCCESS != status) ? stderr : stdout;
        (void) fprintf (usageout,
                        _("Usage: %s [options] LOGIN\n"
                          "\n"
index 7129b7c1229854f882f6c19352841bb69779453f..d59eaeb4ba973fc6283726f37c766b74bad3ab83 100644 (file)
@@ -120,7 +120,7 @@ static void usage (int status)
                 "                                even if not owned by user\n"
                 "  -h, --help                    display this help message and exit\n"
                 "  -r, --remove                  remove home directory and mail spool\n"
-                "\n"), status ? stderr : stdout);
+                "\n"), (E_SUCCESS != status) ? stderr : stdout);
        exit (status);
 }
 
@@ -776,6 +776,7 @@ int main (int argc, char **argv)
                                break;
                        case 'h':
                                usage (E_SUCCESS);
+                               break;
                        case 'r':       /* remove home dir and mailbox */
                                rflg = true;
                                break;
index 7eb5c819880dfdebfd6963fcfd308f84231d6188..ab92009ce8e4d50b2a57c82107d92eacd2d1e415 100644 (file)
@@ -302,7 +302,7 @@ static int get_groups (char *list)
  */
 static void usage (int status)
 {
-       fprintf (status ? stderr : stdout,
+       fprintf ((E_SUCCESS != status) ? stderr : stdout,
                 _("Usage: usermod [options] LOGIN\n"
                 "\n"
                 "Options:\n"
@@ -978,6 +978,7 @@ static void process_flags (int argc, char **argv)
                                break;
                        case 'h':
                                usage (E_SUCCESS);
+                               break;
                        case 'l':
                                if (!is_valid_user_name (optarg)) {
                                        fprintf (stderr,
index 583fd24fb65f28d3d406f18b5125cbcca779a601..746da8c13e2f2d2a3bc6d8a55676d0d322004f71 100644 (file)
@@ -83,7 +83,7 @@ static void usage (int status)
                 "  -p, --passwd                  edit passwd database\n"
                 "  -q, --quiet                   quiet mode\n"
                 "  -s, --shadow                  edit shadow or gshadow database\n"
-                "\n"), status ? stderr : stdout);
+                "\n"), (E_SUCCESS != status) ? stderr : stdout);
        exit (status);
 }