Re: another vasnprintf fix

2007-03-19 Thread Bruno Haible
Eric Blake wrote: > since vasnprintf has the > nice API property that, unlike all other *printf functions, it does not > return an int, it should not need to be limited by INT_MAX; otherwise you > are introducing an artificial limitation You're right; I forgot about this argumentation. My patch co

another vasnprintf fix

2007-03-19 Thread Bruno Haible
Performing the unit tests on NetBSD 3.0 uncovered this: When the "size of given buffer" argument passed to vasnprintf() was > INT_MAX, the function could loop endlessly instead of failing with EOVERFLOW. Note: NetBSD also has a bug here: snprintf() returns -1 with errno = EINVAL, where POSIX says

Re: another vasnprintf fix

2007-03-17 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Bruno Haible on 3/17/2007 6:32 PM: > * lib/vasnprintf.c (EOVERFLOW): New fallback definition. > (VASNPRINTF): Fail with EOVERFLOW when the given allocated size is > larger than INT_MAX, or when it grow to a value larger t