From owner-svn-src-all@FreeBSD.ORG Mon Oct 20 16:10:25 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 293C81065683; Mon, 20 Oct 2008 16:10:25 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id D89728FC18; Mon, 20 Oct 2008 16:10:24 +0000 (UTC) (envelope-from des@des.no) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id C87376D434; Mon, 20 Oct 2008 16:10:23 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id AD0B3844A8; Mon, 20 Oct 2008 18:10:23 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Xin LI References: <200810172121.m9HLLETA098194@svn.freebsd.org> Date: Mon, 20 Oct 2008 18:10:23 +0200 In-Reply-To: <200810172121.m9HLLETA098194@svn.freebsd.org> (Xin LI's message of "Fri, 17 Oct 2008 21:21:14 +0000 (UTC)") Message-ID: <86wsg3gscw.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r183989 - head/lib/libutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Oct 2008 16:10:25 -0000 Xin LI writes: > Modified: head/lib/libutil/login_times.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/lib/libutil/login_times.c Fri Oct 17 21:14:50 2008 (r183988) > +++ head/lib/libutil/login_times.c Fri Oct 17 21:21:14 2008 (r183989) > @@ -72,8 +72,7 @@ parse_lt(const char * str) > char buf[64]; >=20=20 > /* Make local copy and force lowercase to simplify parsing */ > - p =3D strncpy(buf, str, sizeof buf); > - buf[sizeof buf - 1] =3D '\0'; > + p =3D strlcpy(buf, str, sizeof buf); > for (i =3D 0; buf[i]; i++) > buf[i] =3D (char)tolower(buf[i]); This makes absolutely no sense: strncpy() and strlcpy() have different return types. The existing code was safe and worked just fine; why break it? DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no