[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: Ken Hornstein
Subject: Re: [Nmh-workers] scan -width behaves oddly in 1.5RC3
Date: Wed, 06 Jun 2012 16:00:35 -0400

>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.

Well, if by "recent" you mean "over a decade", then I suppose so.

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.

Our push recently (and by recently, I mean for 1.5) has been to set
POSIX as a minimum.  We're not completely unreasonable about it,
but there are limits; we make that call on a case-by-case basis.


reply via email to

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