[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 19:40:10 -0400 |
Ken Hornstein <address@hidden> writes:
>> 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 agree with that ... but why is it failing? If the only reason it's
> failing is because the buffer isn't big enough, that is wrong; it's
> supposed to return the number of bytes it wanted to write. My reading
> of the code we have now is that it's correctly rejecting the case where
> snprintf() returns -1.
[ some experimenting later ... ] What it appears to be doing is filling
the buffer to the specified length and then returning -1 anyway. Given
your argument that there is no reason for it to fail, I suppose the
quickest hack is to assume that -1 means the same as "buffer filled".
regards, tom lane
- [Nmh-workers] scan -width behaves oddly in 1.5RC3, Tom Lane, 2012/06/06
- Re: [Nmh-workers] scan -width behaves oddly in 1.5RC3, Ken Hornstein, 2012/06/06
- Re: [Nmh-workers] scan -width behaves oddly in 1.5RC3, Ken Hornstein, 2012/06/06
- Re: [Nmh-workers] scan -width behaves oddly in 1.5RC3, Tom Lane, 2012/06/06
- Re: [Nmh-workers] scan -width behaves oddly in 1.5RC3, Ken Hornstein, 2012/06/06
- Re: [Nmh-workers] scan -width behaves oddly in 1.5RC3, Tom Lane, 2012/06/06
- Re: [Nmh-workers] scan -width behaves oddly in 1.5RC3, Ken Hornstein, 2012/06/06
- Re: [Nmh-workers] scan -width behaves oddly in 1.5RC3,
Tom Lane <=
- Re: [Nmh-workers] scan -width behaves oddly in 1.5RC3, Ken Hornstein, 2012/06/06
- Re: [Nmh-workers] scan -width behaves oddly in 1.5RC3, paul vixie, 2012/06/06
- Re: [Nmh-workers] scan -width behaves oddly in 1.5RC3, Ralph Corderoy, 2012/06/06
- Re: [Nmh-workers] scan -width behaves oddly in 1.5RC3, valdis . kletnieks, 2012/06/06
- Re: [Nmh-workers] scan -width behaves oddly in 1.5RC3, paul vixie, 2012/06/06
- Re: [Nmh-workers] scan -width behaves oddly in 1.5RC3, Tom Lane, 2012/06/06
- Re: [Nmh-workers] scan -width behaves oddly in 1.5RC3, paul vixie, 2012/06/06