Simplify pointing dst after the end of all the gr_mem pointers in newgr
Submitted by: pjd Reviewed by: db
This commit is contained in:
parent
fe390747e4
commit
7780953ee4
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=244780
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user