diff options
author | Baptiste Daroussin <bapt@FreeBSD.org> | 2012-12-28 20:44:10 +0000 |
---|---|---|
committer | Baptiste Daroussin <bapt@FreeBSD.org> | 2012-12-28 20:44:10 +0000 |
commit | 8f1370df706a16668cc3a3f9be05d8af396c365c (patch) | |
tree | b8509f5b136de37e7d1230bab2e3818ea997cfb9 /libutil | |
parent | e7ae79563ae6e4b961c2343f08df0900b302c822 (diff) | |
download | pw-darwin-8f1370df706a16668cc3a3f9be05d8af396c365c.tar.gz pw-darwin-8f1370df706a16668cc3a3f9be05d8af396c365c.tar.zst pw-darwin-8f1370df706a16668cc3a3f9be05d8af396c365c.zip |
Simplify pointing dst after the end of all the gr_mem pointers in newgr
Submitted by: pjd
Reviewed by: db
Diffstat (limited to 'libutil')
-rw-r--r-- | libutil/gr_util.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/libutil/gr_util.c b/libutil/gr_util.c index 5f803af..acb9767 100644 --- a/libutil/gr_util.c +++ b/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; |