18 Aug
2001
18 Aug
'01
2:11 a.m.
Hi, I finally tracked down what caused this garbage. It was due to void numeric::archive(archive_node &n) const in numeric.cpp where a fixed size buffer is defined if HAVE_SSTREAM is undefined. If I made the following changes $ diff numeric.cpp numeric.cpp.orig 307c307,308 < std::ostrstream s; ---
char buf[1024]; std::ostrstream s(buf, 1024);
329c330,332 < n.add_string("number", s.str()); ---
s << ends; std::string str(buf); n.add_string("number", str);
then the garbage disappered. So, why you define fixed size buffer if ostrstream has the same functionality as ostringstream (at least in gcc system)? Regards, Pearu