Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 Jan 2006 14:11:39 +0000 (GMT)
From:      Robert Watson <rwatson@FreeBSD.org>
To:        Bruce Evans <bde@zeta.org.au>
Cc:        cvs-src@freebsd.org, src-committers@freebsd.org, cvs-all@freebsd.org
Subject:   Re: cvs commit: src/lib/libutil login_times.c
Message-ID:  <20060116141101.V18036@fledge.watson.org>
In-Reply-To: <20060116232254.N2295@epsplex.bde.org>
References:  <200601161154.k0GBs8MD082923@repoman.freebsd.org> <20060116232254.N2295@epsplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060116141101.V18036>