Simplify copying of group members by using memcpy

Submitted by:	Christoph Mallon <christoph.mallon@gmx.de>
This commit is contained in:
Baptiste Daroussin 2012-12-26 23:16:24 +00:00
parent c195c1ba19
commit ae61f4dda6
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=244721

View File

@ -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;