attempt to regularize atoi mess.
[oweals/busybox.git] / loginutils / addgroup.c
index 236dc109914bf2de3e4f2df625377fccf4e8dc8f..0172e6041dde858aeb3ee980434785b79ae473ee 100644 (file)
@@ -91,15 +91,14 @@ int addgroup_main(int argc, char **argv)
 
        /* check for min, max and missing args and exit on error */
        opt_complementary = "-1:?2:?";
-
        if (getopt32(argc, argv, "g:", &group)) {
-               gid = bb_xgetlarg(group, 10, 0, LONG_MAX);
+               gid = xatoul_range(group, 0, (gid_t)ULONG_MAX);
        }
        /* move past the commandline options */
        argv += optind;
 
        /* need to be root */
-       if(geteuid()) {
+       if (geteuid()) {
                bb_error_msg_and_die(bb_msg_perm_denied_are_you_root);
        }