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/03/2015 09:36 AM, Zack Weinberg wrote:
I would not at all be surprised to find code deliberately calling
strlcpy with destination size zero in order to learn how big the
destination buffer needed to be.

Calling strlcpy (DST, SRC, 0) instead of the more-obvious strlen (SRC)? Really? That would be bizarre. I'd like to see an example.

Also, would you be surprised by a call strlcpy (NULL, SRC, 0) instead of the more-obvious strlen (SRC)? Florian's proposed wording (like my proposal) would prohibit such a call. Even though strlcpy (NULL, SRC, 0) works just fine on BSD and the OpenBSD and FreeBSD man pages don't prohibit it, surely glibc doesn't need to support this usage, and surely the same is true for strlcpy (DST, SRC, 0) when DST is non-NULL.


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