Skip to content

Commit

Permalink
Fix number to string conversion failing after a failed string to number
Browse files Browse the repository at this point in the history
conversion
  • Loading branch information
mniip committed May 3, 2018
1 parent 5d80d77 commit 730cf08
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/common/String.cpp
Expand Up @@ -399,6 +399,7 @@ String::Split String::SplitSigned(long long int &value, size_t pos, std::ios_bas
LocaleImpl.wstream >> value;
if(LocaleImpl.wstream.fail())
{
LocaleImpl.wstream.clear();
LocaleImpl.FlushWStream();
return Split(*this, pos, npos, 0, false);
}
Expand All @@ -414,6 +415,7 @@ String::Split String::SplitUnsigned(unsigned long long int &value, size_t pos, s
LocaleImpl.wstream >> value;
if(LocaleImpl.wstream.fail())
{
LocaleImpl.wstream.clear();
LocaleImpl.FlushWStream();
return Split(*this, pos, npos, 0, false);
}
Expand All @@ -429,6 +431,7 @@ String::Split String::SplitFloat(double &value, size_t pos, std::ios_base::fmtfl
LocaleImpl.wstream >> value;
if(LocaleImpl.wstream.fail())
{
LocaleImpl.wstream.clear();
LocaleImpl.FlushWStream();
return Split(*this, pos, npos, 0, false);
}
Expand Down

0 comments on commit 730cf08

Please sign in to comment.