aboutsummaryrefslogtreecommitdiff
path: root/toys/pending/groupadd.c
diff options
context:
space:
mode:
Diffstat (limited to 'toys/pending/groupadd.c')
-rw-r--r--toys/pending/groupadd.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/toys/pending/groupadd.c b/toys/pending/groupadd.c
index ab290e54..8ff539eb 100644
--- a/toys/pending/groupadd.c
+++ b/toys/pending/groupadd.c
@@ -79,8 +79,7 @@ void groupadd_main(void)
if (toys.optc == 2) { //add user to group
//toys.optargs[0]- user, toys.optargs[1] - group
- if (!getpwnam(toys.optargs[0]))
- error_exit("user '%s' does not exist", toys.optargs[0]);
+ xgetpwnam(*toys.optargs);
if (!(grp = getgrnam(toys.optargs[1])))
error_exit("group '%s' does not exist", toys.optargs[1]);
if (!grp->gr_mem) entry = xmsprintf("%s", *toys.optargs);