Ken Hornstein <kenh(_at_)pobox(_dot_)com> 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
Nmh-workers mailing list