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/04/2016 04:02 PM, Alexander Cherepanov wrote:
The description of snprintf in C11 doesn't mention size of the destination array or talk about any connection between n and s at all,

True, but the POSIX description for snprintf (s, n, ...) has the additional restriction that n must be the size of the buffer referred to by s, so POSIX implementations of snprintf can assume that s's size is n and that the destination array does not overlap any of the sources, regardless of which parts of the destination are written to.


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