svn commit: r292454 - head/bin/ed
Garrett Cooper
yaneurabeya at gmail.com
Sat Dec 19 01:27:58 UTC 2015
> On Dec 18, 2015, at 15:46, Conrad Meyer <cem at FreeBSD.org> wrote:
>
>> 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.)
+1 to using strlcpy instead of strcpy/strncpy.
Thanks!
More information about the svn-src-all
mailing list