This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Implement strlcat [BZ#178]


On 12/04/2015 05:06 PM, Paul Eggert wrote:
> On 12/04/2015 03:12 AM, Florian Weimer wrote:
>>> There is no "_exactly_". The BSDs differ.
>> I think the behavior is the same.
> 
> No, as I mentioned elsewhere, the NetBSD iimplementation does not allow
> strlcpy(0, SRC, 0) whereas the FreeBSD implementation does (and this
> disagrees with the FreeBSD documentation where it says the destination
> must be a string).

Hmm.  I looked at this, and everything points towards the NetBSD
implementation being buggy in this regard.  Destination-NULL-size-0 is
supported by snprintf, so it should be supported by strlcpy as well (and
strlcat, by analogy).  I will update my patch accordingly.

The question what to do if the terminator is not found in the
destination buffer (for strlcat) is still open.

Florian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]