nmh-workers
[Top] [All Lists]

Re: [Nmh-workers] scan -width behaves oddly in 1.5RC3

2012-06-06 15:01:02
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.

--Ken

_______________________________________________
Nmh-workers mailing list
Nmh-workers(_at_)nongnu(_dot_)org
https://lists.nongnu.org/mailman/listinfo/nmh-workers

<Prev in Thread] Current Thread [Next in Thread>