svn commit: r244721 - head/usr.sbin/pw
Baptiste Daroussin
bapt at FreeBSD.org
Wed Dec 26 23:16:25 UTC 2012
Author: bapt
Date: Wed Dec 26 23:16:24 2012
New Revision: 244721
URL: http://svnweb.freebsd.org/changeset/base/244721
Log:
Simplify copying of group members by using memcpy
Submitted by: Christoph Mallon <christoph.mallon at gmx.de>
Modified:
head/usr.sbin/pw/pw_user.c
Modified: head/usr.sbin/pw/pw_user.c
==============================================================================
--- head/usr.sbin/pw/pw_user.c Wed Dec 26 23:14:33 2012 (r244720)
+++ head/usr.sbin/pw/pw_user.c Wed Dec 26 23:16:24 2012 (r244721)
@@ -757,8 +757,7 @@ pw_user(struct userconf * cnf, int mode,
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;
More information about the svn-src-all
mailing list