From owner-cvs-all@FreeBSD.ORG Mon Jan 16 14:11:11 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 392AC16A41F; Mon, 16 Jan 2006 14:11:11 +0000 (GMT) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [209.31.154.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id D391F43D45; Mon, 16 Jan 2006 14:11:10 +0000 (GMT) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [209.31.154.41]) by cyrus.watson.org (Postfix) with ESMTP id 2D43146B88; Mon, 16 Jan 2006 09:11:07 -0500 (EST) Date: Mon, 16 Jan 2006 14:11:39 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Bruce Evans In-Reply-To: <20060116232254.N2295@epsplex.bde.org> Message-ID: <20060116141101.V18036@fledge.watson.org> References: <200601161154.k0GBs8MD082923@repoman.freebsd.org> <20060116232254.N2295@epsplex.bde.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 14:11:11 -0000 On Mon, 16 Jan 2006, Bruce Evans wrote: >> 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.) A lesson that can be learned a surprising number of times and still not entirely stick. Oh well :-). Thanks, Robert N M Watson