diff options
| author | Baptiste Daroussin <bapt@FreeBSD.org> | 2012-12-26 23:16:24 +0000 |
|---|---|---|
| committer | Baptiste Daroussin <bapt@FreeBSD.org> | 2012-12-26 23:16:24 +0000 |
| commit | e02eb3b3d39827fc7edf6c88e3cbb481427b6484 (patch) | |
| tree | fcb79bfd6e8b8d0ffa239b47bd7a5145ae817acc | |
| parent | f5a04a9f49ff5a1dd493c135efbf0e9dde2c97d1 (diff) | |
| download | pw-darwin-e02eb3b3d39827fc7edf6c88e3cbb481427b6484.tar.gz pw-darwin-e02eb3b3d39827fc7edf6c88e3cbb481427b6484.zip | |
Simplify copying of group members by using memcpy
Submitted by: Christoph Mallon <christoph.mallon@gmx.de>
| -rw-r--r-- | pw/pw_user.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/pw/pw_user.c b/pw/pw_user.c index 43119ed..74c1ef9 100644 --- a/pw/pw_user.c +++ b/pw/pw_user.c @@ -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; |
