On Fri, Dec 15, 2006 at 08:25:18PM +0100, Enrico Forestieri wrote:
> > $ ./showtoandre
> > <1.189731495357231765021263853030970205169063e+4932>
> >
> > 64 is large enough...
>
> Argh! Not true on solaris...
Fixed.
--
Enrico
Index: src/support/docstring.C
===================================================================
--- src/support/docstring.C (revision 16291)
+++ src/support/docstring.C (working copy)
@@ -497,8 +497,11 @@ private:
if (fill >= 0x80)
throw num_put_failure();
- // 64 is large enough
- std::string s(64, '\0');
+ std::streamsize const sz = b.width() > b.precision() ?
+ b.width() : b.precision();
+ // 64 is large enough, unless width or precision are bigger
+ std::streamsize const wd = (sz > 56 ? sz : 56) + 8;
+ std::string s(wd, '\0');
string_num_put_facet f;
std::string::const_iterator cit = s.begin();
std::string::const_iterator end =