svn commit: r292454 - head/bin/ed

Conrad Meyer cem at FreeBSD.org
Sat Dec 19 00:45:21 UTC 2015


On Fri, Dec 18, 2015 at 2:44 PM, Pedro Giffuni <pfg at freebsd.org> wrote:
> Hi Warner;
>
>> Il giorno 18/dic/2015, alle ore 17:01, Warner Losh <imp at bsdimp.com> ha scritto:
>>
>> Isn’t strlcpy() the more appropriate interface? strncpy doesn’t guarantee NUL termination.
>>
>
> Maybe, but we were using strcpy() which doesn’t guarantee NULL termination either
> and things have been working. I also thought that portability may be specially important
> for the stuff in bin/.

strcpy() does guarantee NUL termination.  Otherwise it would be useless.

DESCRIPTION
     The stpcpy() and strcpy() functions copy the string src to dst (including
     the terminating ‘\0’ character.)

Best,
Conrad


More information about the svn-src-head mailing list