mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-13 10:02:38 +00:00
Simplify copying of group members by using memcpy
Submitted by: Christoph Mallon <christoph.mallon@gmx.de>
This commit is contained in:
parent
c195c1ba19
commit
ae61f4dda6
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=244721
@ -757,8 +757,7 @@ pw_user(struct userconf * cnf, int mode, struct cargs * args)
|
||||
continue;
|
||||
|
||||
members = malloc(sizeof(char *) * (j + 2));
|
||||
for (j = 0; grp->gr_mem[j] != NULL; j++)
|
||||
members[j] = grp->gr_mem[j];
|
||||
memcpy(members, grp->gr_mem, j * sizeof(*members));
|
||||
|
||||
members[j] = pwd->pw_name;
|
||||
members[j+1] = NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user