From 5291d7c50b6921b8e216bdc22ab63ba33e020be2 Mon Sep 17 00:00:00 2001 From: Ethan Sommer Date: Tue, 14 Apr 2020 20:41:18 -0400 Subject: groupadd: fix -Wformat and switch to FLAG() macros --- toys/pending/groupadd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'toys') 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, "!"); -- cgit v1.2.3