[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

From: Tom Lane
Subject: Re: [Nmh-workers] scan -width behaves oddly in 1.5RC3
Date: Wed, 06 Jun 2012 16:15:56 -0400

Ken Hornstein <address@hidden> 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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]