aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/newgrp
diff options
context:
space:
mode:
authorXin LI <delphij@FreeBSD.org>2011-10-16 07:05:43 +0000
committerXin LI <delphij@FreeBSD.org>2011-10-16 07:05:43 +0000
commit41cbfdc95445e800b676aafd971fe7ef45457584 (patch)
tree49d45572607d22e9a366b985efa53be3634ff891 /usr.bin/newgrp
parent5d9fefacf242fc8db7b169257fab739c798bfe77 (diff)
Partially revert r226274, the old code was right.
Notes
Notes: svn path=/head/; revision=226416
Diffstat (limited to 'usr.bin/newgrp')
-rw-r--r--usr.bin/newgrp/newgrp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.bin/newgrp/newgrp.c b/usr.bin/newgrp/newgrp.c
index 81983011ce65..5381b15555fb 100644
--- a/usr.bin/newgrp/newgrp.c
+++ b/usr.bin/newgrp/newgrp.c
@@ -220,7 +220,7 @@ addgroup(const char *grpname)
/* Add old effective gid to supp. list if it does not exist. */
if (egid != grp->gr_gid && !inarray(egid, grps, ngrps)) {
- if (ngrps + 1 >= ngrps_max)
+ if (ngrps == ngrps_max)
warnx("too many groups");
else {
grps[ngrps++] = egid;