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 | 7780953ee480a6f2493944b8ae4dc4b8bc9985bb (patch) | |
tree | 9fa00a7f6583ff579f268b3d1b18bb5a2f33e5ec | |
parent | fe390747e46cb3d19bb5ac2980f82e45acb7fcf0 (diff) | |
download | src-7780953ee480a6f2493944b8ae4dc4b8bc9985bb.tar.gz src-7780953ee480a6f2493944b8ae4dc4b8bc9985bb.zip |
Simplify pointing dst after the end of all the gr_mem pointers in newgr
Submitted by: pjd
Reviewed by: db
Notes
Notes:
svn path=/head/; revision=244780
-rw-r--r-- | lib/libutil/gr_util.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/libutil/gr_util.c b/lib/libutil/gr_util.c index 5f803af6f6b3..acb9767c6010 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; |