|
Boost Users : |
From: Fred Jackson (yg-boost-users_at_[hidden])
Date: 2002-11-04 04:31:25
I found a bug in the format library and fixed it.
strm << boost::format("%64.64s") % "hello";
gave an access violation. It was caused by passing an
argument greater than the string length to std::string::erase.
I added a check so as not to try to erase text that is not there.
Here is a diff of my small fix.
< is feed_args.hpp from the boost_1_29_0 distribution.
> is my fixed file.
158c158,162
< if (specs.truncate_ >= 0)
--- > // @@@@@ fjackson 20021022 Added test to make sure we don't call > // std::string::erase with an arg greater than the length - this > // caused an access violation, noted on outputting a short string > // with a %64.64 format specifier. > if (specs.truncate_ >= 0 && specs.truncate_ < res.length())
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net