From 5d72f4252ac5d7b661402340d22f3652537c8b72 Mon Sep 17 00:00:00 2001 From: Jakob Schlyter Date: Sat, 24 Mar 2001 19:20:52 +0000 Subject: fix strlcpy; --- usr.sbin/user/user.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'usr.sbin') diff --git a/usr.sbin/user/user.c b/usr.sbin/user/user.c index c1ea4423cd6..e48994ea7e7 100644 --- a/usr.sbin/user/user.c +++ b/usr.sbin/user/user.c @@ -1,4 +1,4 @@ -/* $OpenBSD: user.c,v 1.19 2001/02/13 09:18:33 deraadt Exp $ */ +/* $OpenBSD: user.c,v 1.20 2001/03/24 19:20:51 jakob Exp $ */ /* $NetBSD: user.c,v 1.17 2000/04/14 06:26:55 simonb Exp $ */ /* @@ -1145,7 +1145,7 @@ useradd(int argc, char **argv) bigD = 1; break; case 'G': - strlcpy (buf, optarg, strlen (optarg) + 1); + strlcpy (buf, optarg, sizeof(buf)); p = buf; while ((s = strsep (&p, ",")) != NULL && u.u_groupc < NGROUPS_MAX - 2) @@ -1264,7 +1264,7 @@ usermod(int argc, char **argv) while ((c = getopt(argc, argv, "G:c:d:e:f:g:l:mos:u:" MOD_OPT_EXTENSIONS)) != -1) { switch(c) { case 'G': - strlcpy (buf, optarg, strlen (optarg) + 1); + strlcpy (buf, optarg, sizeof(buf)); p = buf; while ((s = strsep (&p, ",")) != NULL && u.u_groupc < NGROUPS_MAX - 2) -- cgit v1.2.3