]> granicus.if.org Git - shadow/blobdiff - src/grpck.c
* src/newgrp.c, src/chfn.c, src/groupmems.c, src/usermod.c,
[shadow] / src / grpck.c
index 6b3193c2cdb0d03ea7d543edb57b31fa12800bbe..ca4d72e18d9c7d56a1b34106888f3bd562b7967f 100644 (file)
@@ -53,7 +53,7 @@
 /*
  * Exit codes
  */
-
+/*@-exitarg@*/
 #define        E_OKAY          0
 #define        E_USAGE         1
 #define        E_BAD_ENTRY     2
@@ -467,7 +467,7 @@ static void check_grp_file (int *errors, bool *changed)
                         * Tell the user this entire line is bogus and ask
                         * them to delete it.
                         */
-                       puts (_("invalid group file entry"));
+                       (void) puts (_("invalid group file entry"));
                        printf (_("delete line '%s'? "), gre->line);
                        *errors += 1;
 
@@ -527,7 +527,7 @@ static void check_grp_file (int *errors, bool *changed)
                         * Tell the user this entry is a duplicate of
                         * another and ask them to delete it.
                         */
-                       puts (_("duplicate group entry"));
+                       (void) puts (_("duplicate group entry"));
                        printf (_("delete line '%s'? "), gre->line);
                        *errors += 1;
 
@@ -584,10 +584,9 @@ static void check_grp_file (int *errors, bool *changed)
                if (is_shadow) {
                        sgr = (struct sgrp *) sgr_locate (grp->gr_name);
                        if (sgr == NULL) {
-                               printf (_
-                                       ("no matching group file entry in %s\n"),
+                               printf (_("no matching group file entry in %s\n"),
                                        sgr_file);
-                               printf (_("add group '%s' in %s?"),
+                               printf (_("add group '%s' in %s? "),
                                        grp->gr_name, sgr_file);
                                *errors += 1;
                                if (yes_or_no (read_only)) {
@@ -661,7 +660,7 @@ static void check_sgr_file (int *errors, bool *changed)
                         * Tell the user this entire line is bogus and ask
                         * them to delete it.
                         */
-                       puts (_("invalid shadow group file entry"));
+                       (void) puts (_("invalid shadow group file entry"));
                        printf (_("delete line '%s'? "), sge->line);
                        *errors += 1;
 
@@ -721,7 +720,7 @@ static void check_sgr_file (int *errors, bool *changed)
                         * Tell the user this entry is a duplicate of
                         * another and ask them to delete it.
                         */
-                       puts (_("duplicate shadow group entry"));
+                       (void) puts (_("duplicate shadow group entry"));
                        printf (_("delete line '%s'? "), sge->line);
                        *errors += 1;
 
@@ -834,11 +833,13 @@ int main (int argc, char **argv)
         * Tell the user what we did and exit.
         */
        if (0 != errors) {
-               printf (changed ?
-                       _("%s: the files have been updated\n") :
-                       _("%s: no changes\n"), Prog);
+               if (changed) {
+                       printf (_("%s: the files have been updated\n"), Prog);
+               } else {
+                       printf (_("%s: no changes\n"), Prog);
+               }
        }
 
-       exit ((0 != errors) ? E_BAD_ENTRY : E_OKAY);
+       return ((0 != errors) ? E_BAD_ENTRY : E_OKAY);
 }