Date: Fri, 18 Dec 2015 20:52:17 -0500 From: Pedro Giffuni <pfg@FreeBSD.org> To: cem@FreeBSD.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r292454 - head/bin/ed Message-ID: <3C185FD1-F245-4B75-9CE6-CD217AF94B28@FreeBSD.org> 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
> Il giorno 18/dic/2015, alle ore 18:46, Conrad Meyer <cem@FreeBSD.org> = ha scritto: >=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 scritto: >>>=20 >>> Isn=E2=80=99t strlcpy() the more appropriate interface? strncpy = doesn=E2=80=99t guarantee NUL termination. >>>=20 >>=20 >> Maybe, but we were using strcpy() which doesn=E2=80=99t guarantee = NULL termination either >> and things have been working. I also thought that portability may be = specially important >> for the stuff in bin/. >=20 > strcpy() does guarantee NUL termination. Otherwise it would be = useless. >=20 Yes , my bad. I come from a non-C background and sometimes tend to (erronously) think = the C library designers would keep some consistency :-/. I changed it to strlcpy() a while ago. Pedro.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3C185FD1-F245-4B75-9CE6-CD217AF94B28>