This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v2] Implement strlcpy [BZ #178]
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Florian Weimer <fweimer at redhat dot com>
- Cc: <libc-alpha at sourceware dot org>
- Date: Wed, 17 Sep 2014 15:41:56 +0000
- Subject: Re: [PATCH v2] Implement strlcpy [BZ #178]
- Authentication-results: sourceware.org; auth=none
- References: <5416EDEA dot 4080903 at redhat dot com> <541987BF dot 7000104 at redhat dot com>
On Wed, 17 Sep 2014, Florian Weimer wrote:
> I misremembered what the GNU coding standards say about dynamically sized
> buffers. As far as I can tell, they recommend it not in general, but only as
> a way to avoid unintentional copyright infringement. That's why I didn't add
> a reference to the coding standards.
@node Semantics
@section Writing Robust Programs
@cindex arbitrary limits on data
Avoid arbitrary limits on the length or number of @emph{any} data
structure, including file names, lines, files, and symbols, by allocating
all data structures dynamically. In most Unix utilities, ``long lines
are silently truncated''. This is not acceptable in a GNU utility.
--
Joseph S. Myers
joseph@codesourcery.com