The following reply was made to PR docs/180767; it has been noted by GNATS.

From: Benjamin Kaduk <ka...@mit.edu>
To: bug-follo...@freebsd.org
Cc:  
Subject: Re: docs/180767: [man][libc] printf.3: fix off-by-one in snprintf
 description
Date: Tue, 23 Jul 2013 17:07:02 -0400 (EDT)

 On Tue, 23 Jul 2013, Dmitry Marakasov wrote:
 
 >
 >
 >> Description:
 > printf(3) says for snprintf:
 >
 >     The snprintf() and vsnprintf() functions will write at most size-1 of the
 >     characters printed into the output string (the size'th character then
 >     gets the terminating `\0');
 >
 > the part in parenteses is incorrect: size'th character is outside
 > buffer of [size] characters. It should instead say "(size-1)'th
 > character" (which is last in the buffer).
 
 I think one could argue either way.  The character with index (size-1) 
 gets the NUL byte, but if one says that the first character is the one 
 with index 0, then it is in fact the size'th character which receives the 
 NUL.
 
 -Ben Kaduk
_______________________________________________
freebsd-doc@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-doc
To unsubscribe, send any mail to "freebsd-doc-unsubscr...@freebsd.org"

Reply via email to