nmh-workers
[Top] [All Lists]

Re: [Nmh-workers] scan -width behaves oddly in 1.5RC3

2012-06-06 15:16:17
Ken Hornstein <kenh(_at_)pobox(_dot_)com> writes:
I suspect if you check the return value of snprintf() in this case
you'll find it's been set to -1.  And in my reading of the standard
it seems clear that it's supposed to write as many bytes as will
fit in the buffer.

I haven't had time to check, but I suspect -1 is what it's giving.
I disagree with your reading of the standard though: -1 means failure,
and in a failure case there is not any specification about what went
into the buffer.  I am prepared to agree that if the result is positive,
then the buffer should have been filled to min(result, buflen) bytes.

                        regards, tom lane

_______________________________________________
Nmh-workers mailing list
Nmh-workers(_at_)nongnu(_dot_)org
https://lists.nongnu.org/mailman/listinfo/nmh-workers

<Prev in Thread] Current Thread [Next in Thread>