>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
[email protected]
https://lists.nongnu.org/mailman/listinfo/nmh-workers

Reply via email to