Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 18 Dec 2015 17:27:55 -0800
From:      Garrett Cooper <yaneurabeya@gmail.com>
To:        cem@FreeBSD.org
Cc:        Pedro Giffuni <pfg@freebsd.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r292454 - head/bin/ed
Message-ID:  <CC23C649-9CA1-44B5-8531-51F8BF2B8942@gmail.com>
In-Reply-To: <CAG6CVpWMXqzW6qBL2wE9e_ezjKF6WauMHsK-yb66yNUNvYOhaQ@mail.gmail.com>
References:  <201512182158.tBILwhRB040583@repo.freebsd.org> <44E9BE06-1883-4AF8-816D-D699CF733EEB@bsdimp.com> <DCA75AAB-5752-44E4-90B9-FC33404EA350@FreeBSD.org> <CAG6CVpWMXqzW6qBL2wE9e_ezjKF6WauMHsK-yb66yNUNvYOhaQ@mail.gmail.com>

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

> On Dec 18, 2015, at 15:46, Conrad Meyer <cem@FreeBSD.org> wrote:
>=20
>> On Fri, Dec 18, 2015 at 2:44 PM, Pedro Giffuni <pfg@freebsd.org> wrote:
>> Hi Warner;
>>=20
>>> Il giorno 18/dic/2015, alle ore 17:01, Warner Losh <imp@bsdimp.com> ha s=
critto:
>>>=20
>>> Isn=81ft strlcpy() the more appropriate interface? strncpy doesn=81ft gu=
arantee NUL termination.
>>=20
>> Maybe, but we were using strcpy() which doesn=81ft guarantee NULL termina=
tion either
>> and things have been working. I also thought that portability may be spec=
ially important
>> for the stuff in bin/.
>=20
> strcpy() does guarantee NUL termination.  Otherwise it would be useless.
>=20
> DESCRIPTION
>     The stpcpy() and strcpy() functions copy the string src to dst (includ=
ing
>     the terminating =81e\0=81f character.)

+1 to using strlcpy instead of strcpy/strncpy.
Thanks!=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CC23C649-9CA1-44B5-8531-51F8BF2B8942>