[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 15:41:50 -0400

Ken Hornstein <address@hidden> writes:
>> So my conjecture is that on your systmes if
>> snprintf() cannot fit a value in the width specified then it simply
>> refuses to put anything in there.  My reading of the specification
>> is that this is the correct behavior.

> Whoops, I meant to say this is INCORRECT behavior.  But the more I look
> at it the more I'm thinking you're getting tripped up by the old glibc
> bug with snprintf().

Well, this is an ancient HPUX box, and it most certainly isn't using
glibc.  I think that portable software shouldn't be assuming very much
about what snprintf does when the string doesn't fit; it's only in
rather recent editions of POSIX that that's nailed down, and even there
it seems to be only implied, not stated explicitly, that the buffer
should be filled as far as possible.  I will take a look and see how
painful it is to remove the assumption.

                        regards, tom lane

reply via email to

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