[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
- [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 <=
- 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, 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