Have FromString report failure when it read NaN or INF.
This commit is contained in:
@@ -1905,7 +1905,7 @@ bool FromString( const RString &sValue, float &out )
|
||||
{
|
||||
const char *endptr = sValue.data() + sValue.size();
|
||||
out = strtof( sValue, (char **) &endptr );
|
||||
return endptr != sValue.data();
|
||||
return endptr != sValue.data() && isfinite( out );
|
||||
}
|
||||
|
||||
bool FromString( const RString &sValue, bool &out )
|
||||
|
||||
Reference in New Issue
Block a user