summaryrefslogtreecommitdiffhomepage
path: root/loginutils/addgroup.c
diff options
context:
space:
mode:
Diffstat (limited to 'loginutils/addgroup.c')
-rw-r--r--loginutils/addgroup.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/loginutils/addgroup.c b/loginutils/addgroup.c
index 4d4fc3f28..6b2fd7ba9 100644
--- a/loginutils/addgroup.c
+++ b/loginutils/addgroup.c
@@ -186,7 +186,7 @@ int addgroup_main(int argc UNUSED_PARAM, char **argv)
gr = xgetgrnam(argv[1]); /* unknown group: exit */
/* check if user is already in this group */
for (; *(gr->gr_mem) != NULL; (gr->gr_mem)++) {
- if (!strcmp(argv[0], *(gr->gr_mem))) {
+ if (strcmp(argv[0], *(gr->gr_mem)) == 0) {
/* user is already in group: do nothing */
return EXIT_SUCCESS;
}