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