mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-07-31 05:30:23 +02:00
Fix number to string conversion failing after a failed string to number
conversion
This commit is contained in:
@@ -399,6 +399,7 @@ String::Split String::SplitSigned(long long int &value, size_t pos, std::ios_bas
|
|||||||
LocaleImpl.wstream >> value;
|
LocaleImpl.wstream >> value;
|
||||||
if(LocaleImpl.wstream.fail())
|
if(LocaleImpl.wstream.fail())
|
||||||
{
|
{
|
||||||
|
LocaleImpl.wstream.clear();
|
||||||
LocaleImpl.FlushWStream();
|
LocaleImpl.FlushWStream();
|
||||||
return Split(*this, pos, npos, 0, false);
|
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;
|
LocaleImpl.wstream >> value;
|
||||||
if(LocaleImpl.wstream.fail())
|
if(LocaleImpl.wstream.fail())
|
||||||
{
|
{
|
||||||
|
LocaleImpl.wstream.clear();
|
||||||
LocaleImpl.FlushWStream();
|
LocaleImpl.FlushWStream();
|
||||||
return Split(*this, pos, npos, 0, false);
|
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;
|
LocaleImpl.wstream >> value;
|
||||||
if(LocaleImpl.wstream.fail())
|
if(LocaleImpl.wstream.fail())
|
||||||
{
|
{
|
||||||
|
LocaleImpl.wstream.clear();
|
||||||
LocaleImpl.FlushWStream();
|
LocaleImpl.FlushWStream();
|
||||||
return Split(*this, pos, npos, 0, false);
|
return Split(*this, pos, npos, 0, false);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user