summaryrefslogtreecommitdiffstats
path: root/lib/libutil
diff options
context:
space:
mode:
authorbapt <bapt@FreeBSD.org>2012-12-28 20:44:10 +0000
committerbapt <bapt@FreeBSD.org>2012-12-28 20:44:10 +0000
commit9db4d3200a9d4f5851e975b66f6e53e8d66b55ae (patch)
tree9fa00a7f6583ff579f268b3d1b18bb5a2f33e5ec /lib/libutil
parent3c6bd22efebf26dd6f310e2b25fbd4a1f544aee1 (diff)
downloadFreeBSD-src-9db4d3200a9d4f5851e975b66f6e53e8d66b55ae.zip
FreeBSD-src-9db4d3200a9d4f5851e975b66f6e53e8d66b55ae.tar.gz
Simplify pointing dst after the end of all the gr_mem pointers in newgr
Submitted by: pjd Reviewed by: db
Diffstat (limited to 'lib/libutil')
-rw-r--r--lib/libutil/gr_util.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/libutil/gr_util.c b/lib/libutil/gr_util.c
index 5f803af..acb9767 100644
--- a/lib/libutil/gr_util.c
+++ b/lib/libutil/gr_util.c
@@ -456,8 +456,7 @@ gr_dup(const struct group *gr)
else
newgr->gr_mem = NULL;
/* point dst after the end of all the gr_mem pointers in newgr */
- dst = (char *)newgr + sizeof(struct group) +
- (num_mem + 1) * sizeof(*gr->gr_mem);
+ dst = (char *)&newgr->gr_mem[num_mem + 1];
if (gr->gr_name != NULL) {
newgr->gr_name = dst;
dst = stpcpy(dst, gr->gr_name) + 1;
OpenPOWER on IntegriCloud