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