Re: return value check in snprintf(3) example code

2019-01-19 Thread Ingo Schwarze
Hi Theo and Theo, Theo de Raadt wrote on Fri, Jan 18, 2019 at 08:06:32PM -0700: > Ted Unangst wrote: >> Theo Buehler wrote: >>> According to our documentation and all the standards I checked, >>> snprintf() returns a negative value on error, not necessarily -1. >>> This confused me quite a bit

Re: return value check in snprintf(3) example code

2019-01-18 Thread Theo de Raadt
Ted Unangst wrote: > Theo Buehler wrote: > > According to our documentation and all the standards I checked, > > snprintf() returns a negative value on error, not necessarily -1. > > This confused me quite a bit recently so I suggest to adjust the > > example code as follows: > > I don't know.

Re: return value check in snprintf(3) example code

2019-01-18 Thread Ted Unangst
Theo Buehler wrote: > According to our documentation and all the standards I checked, > snprintf() returns a negative value on error, not necessarily -1. > This confused me quite a bit recently so I suggest to adjust the > example code as follows: I don't know. I guess it's technially correct, bu

return value check in snprintf(3) example code

2019-01-18 Thread Theo Buehler
According to our documentation and all the standards I checked, snprintf() returns a negative value on error, not necessarily -1. This confused me quite a bit recently so I suggest to adjust the example code as follows: Index: lib/libc/stdio/printf.3 ==