Improve the num_get locale facet

* src/support/docstring.C
	(do_get): use reserve() and the += operator in order to
	avoid a possible buffer overrun.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16070 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Enrico Forestieri 2006-11-27 01:52:26 +00:00
parent 8e6e970d7b
commit 1a7aec0731

View File

@ -465,9 +465,9 @@ protected:
std::ios_base::iostate & err, long & v) const
{
std::string s;
s.resize(64);
for (int i = 0; iit != eit && isNumpunct(*iit); ++i, ++iit)
s[i] = static_cast<char>(*iit);
s.reserve(64);
for (; iit != eit && isNumpunct(*iit); ++iit)
s += static_cast<char>(*iit);
string_num_get_facet f;
f.get(s.begin(), s.end(), b, err, v);