mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-26 11:16:55 +00:00
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:
parent
8e6e970d7b
commit
1a7aec0731
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user