From owner-cvs-all@FreeBSD.ORG Mon Jan 16 12:34:54 2006 Return-Path: X-Original-To: cvs-all@freebsd.org Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A7DAA16A41F; Mon, 16 Jan 2006 12:34:54 +0000 (GMT) (envelope-from bde@zeta.org.au) Received: from mailout1.pacific.net.au (mailout1.pacific.net.au [61.8.0.84]) by mx1.FreeBSD.org (Postfix) with ESMTP id ED3A543D46; Mon, 16 Jan 2006 12:34:53 +0000 (GMT) (envelope-from bde@zeta.org.au) Received: from mailproxy1.pacific.net.au (mailproxy1.pacific.net.au [61.8.0.86]) by mailout1.pacific.net.au (8.13.4/8.13.4/Debian-3) with ESMTP id k0GCYpWZ023561; Mon, 16 Jan 2006 23:34:51 +1100 Received: from epsplex.bde.org (katana.zip.com.au [61.8.7.246]) by mailproxy1.pacific.net.au (8.13.4/8.13.4/Debian-3) with ESMTP id k0GCYnqh009776; Mon, 16 Jan 2006 23:34:50 +1100 Date: Mon, 16 Jan 2006 23:34:49 +1100 (EST) From: Bruce Evans X-X-Sender: bde@epsplex.bde.org To: Robert Watson In-Reply-To: <200601161154.k0GBs8MD082923@repoman.freebsd.org> Message-ID: <20060116232254.N2295@epsplex.bde.org> References: <200601161154.k0GBs8MD082923@repoman.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: cvs-src@freebsd.org, src-committers@freebsd.org, cvs-all@freebsd.org Subject: Re: cvs commit: src/lib/libutil login_times.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2006 12:34:54 -0000 On Mon, 16 Jan 2006, Robert Watson wrote: > rwatson 2006-01-16 11:54:08 UTC > > FreeBSD src repository > > Modified files: > lib/libutil login_times.c > Log: > Restore use of strncpy(), as there is later unconditional termination > of the string, and reliance on the returned pointer. > > Found by: bde (tm) Thanks. Heheh. I didn't actually notice the reliance on the returned pointer. This is a good example that even trivial changes need testing. (p = strncpy(...) was changed to p = strlcpy(...), but strncpy() returns "char *" while strlcpy() returns size_t, so the code fails compile-time testing provided error output is noticed.) Bruce