[PATCH v2] Implement strlcpy [BZ #178]
Joseph S. Myers
joseph@codesourcery.com
Wed Sep 17 15:42:00 GMT 2014
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
More information about the Libc-alpha
mailing list