Handle exceptions in int conversions (#2092)
* RageUtil: Add exception-safe wrappers around std::stoi, stol, stoll * Replace use of std::stoi with exception-safe StringToInt
This commit is contained in:
+2
-2
@@ -377,12 +377,12 @@ void GameCommand::LoadOne( const Command& cmd )
|
||||
|
||||
else if( sName == "weight" )
|
||||
{
|
||||
m_iWeightPounds = std::stoi( sValue );
|
||||
m_iWeightPounds = StringToInt( sValue );
|
||||
}
|
||||
|
||||
else if( sName == "goalcalories" )
|
||||
{
|
||||
m_iGoalCalories = std::stoi( sValue );
|
||||
m_iGoalCalories = StringToInt( sValue );
|
||||
}
|
||||
|
||||
else if( sName == "goaltype" )
|
||||
|
||||
Reference in New Issue
Block a user