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
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to