[PATCH v7] Implement strlcpy, strlcat [BZ #178]

Paul Eggert eggert@cs.ucla.edu
Tue Jan 5 00:52:00 GMT 2016


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.



More information about the Libc-alpha mailing list