Permalink
Browse files

Fix number to string conversion failing after a failed string to number

conversion
  • Loading branch information...
mniip committed May 3, 2018
1 parent 5d80d77 commit 730cf0806a0e9bd123ccb3c97a3f9b7a93fe317c
Showing with 3 additions and 0 deletions.
  1. +3 −0 src/common/String.cpp
@@ -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);
}
@@ -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);
}
@@ -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);
}

0 comments on commit 730cf08

Please sign in to comment.