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 v7] Implement strlcpy, strlcat [BZ #178]


On 01/05/2016 11:14 AM, Alexander Cherepanov wrote:
Your first reading of POSIX seems quite reasonable to me. And that reading conflicts with C11 so I reported it in http://austingroupbugs.net/view.php?id=1020 .


I was referring to the C11 semantics, which POSIX defers to. In looking at that bug-report trail, it appears that the semantics of snprintf are controversial in this area. And rightly so, since C11 requires implementations to not diagnose troublesome application usage such as snprintf (buf, SIZE_MAX, ...).

But now that we are agree to ignore POSIX for a moment, this detail is not important.


True.


it boils down to the question which sources are considers authoritative for describing strlcpy/strlcat?

There aren't any. The BSD man pages do not agree, and their implementations do not agree. If we add strlcpy/strlcat, we will just need to use our best judgment to distinguish valid from buggy uses.


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