aboutsummaryrefslogtreecommitdiff
path: root/toys/pending
diff options
context:
space:
mode:
authorEthan Sommer <e5ten.arch@gmail.com>2020-04-14 20:41:18 -0400
committerRob Landley <rob@landley.net>2020-04-15 00:53:02 -0500
commit5291d7c50b6921b8e216bdc22ab63ba33e020be2 (patch)
tree3bbbb0e12e70f81d44baab14b413f7664e058037 /toys/pending
parent8ea3ff4e32cf1ca4eb05ca7783ff90b564141c27 (diff)
downloadtoybox-5291d7c50b6921b8e216bdc22ab63ba33e020be2.tar.gz
groupadd: fix -Wformat and switch to FLAG() macros
Diffstat (limited to 'toys/pending')
-rw-r--r--toys/pending/groupadd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/toys/pending/groupadd.c b/toys/pending/groupadd.c
index 30468c94..642b4a08 100644
--- a/toys/pending/groupadd.c
+++ b/toys/pending/groupadd.c
@@ -39,17 +39,17 @@ static void new_group()
{
char *entry = NULL;
- if (toys.optflags & FLAG_g) {
+ if (FLAG(g)) {
if (TT.gid > INT_MAX) error_exit("gid should be less than '%d' ", INT_MAX);
if (getgrgid(TT.gid)) error_exit("group '%ld' is in use", TT.gid);
} else {
- if (toys.optflags & FLAG_S) TT.gid = CFG_TOYBOX_UID_SYS;
+ if (FLAG(S)) TT.gid = CFG_TOYBOX_UID_SYS;
else TT.gid = CFG_TOYBOX_UID_USR;
//find unused gid
while (getgrgid(TT.gid)) TT.gid++;
}
- entry = xmprintf("%s:%s:%d:", *toys.optargs, "x", TT.gid);
+ entry = xmprintf("%s:%s:%ld:", *toys.optargs, "x", TT.gid);
update_password(GROUP_PATH, *toys.optargs, entry);
free(entry);
entry = xmprintf("%s:%s::", *toys.optargs, "!");