gid_min = getdef_unum ("GID_MIN", 1000);
gid_max = getdef_unum ("GID_MAX", 60000);
+ /*
+ * Start with the lowest GID.
+ */
+ group_id = gid_min;
+
/*
* Search the entire group file, looking for the largest unused
* value.
* note: -K GID_MIN=10,GID_MAX=499 doesn't work yet
*/
cp = strchr (optarg, '=');
- if (!cp) {
+ if (NULL == cp) {
fprintf (stderr,
_
("%s: -K requires KEY=VALUE\n"),
* Check if the group already exist.
*/
/* local, no need for xgetgrnam */
- if (getgrnam (group_name)) {
+ if (getgrnam (group_name) != NULL) {
/* The group already exist */
if (fflg) {
/* OK, no need to do anything */