Re: glibc's snprintf can fail with ENOMEM: replacement needed

2008-04-11 Thread Jim Meyering
Bruno Haible <[EMAIL PROTECTED]> wrote: > Jim Meyering wrote: >> FYI, I've just reported the problem: >> >> http://bugzilla.redhat.com/441945 >> http://thread.gmane.org/gmane.comp.lib.glibc.alpha/13288 >> >> Quick summary: given a small buffer, say "char b[10];" with the latest >> upstream

Re: glibc's snprintf can fail with ENOMEM: replacement needed

2008-04-11 Thread Bruno Haible
Eric Blake wrote: > According to Bruno Haible on 4/11/2008 4:43 AM: > | 1) for float to decimal conversion, think of snprintf (NULL, "%Le", x) > | or snprintf (NULL, "%Lf", x) > | > | At least in the first case, I don't see how the number of output bytes could > | be determined without doing

Re: glibc's snprintf can fail with ENOMEM: replacement needed

2008-04-11 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Bruno Haible on 4/11/2008 4:43 AM: | 1) for float to decimal conversion, think of snprintf (NULL, "%Le", x) | or snprintf (NULL, "%Lf", x) | | At least in the first case, I don't see how the number of output bytes could | be determ

Re: glibc's snprintf can fail with ENOMEM: replacement needed

2008-04-11 Thread Bruno Haible
Jim Meyering wrote: > FYI, I've just reported the problem: > > http://bugzilla.redhat.com/441945 > http://thread.gmane.org/gmane.comp.lib.glibc.alpha/13288 > > Quick summary: given a small buffer, say "char b[10];" with the latest > upstream glibc, snprintf (b, sizeof b, fmt, 0) can fail,

glibc's snprintf can fail with ENOMEM: replacement needed

2008-04-11 Thread Jim Meyering
FYI, I've just reported the problem: http://bugzilla.redhat.com/441945 http://thread.gmane.org/gmane.comp.lib.glibc.alpha/13288 Quick summary: given a small buffer, say "char b[10];" with the latest upstream glibc, snprintf (b, sizeof b, fmt, 0) can fail, returning -1 with ENOMEM. The pr