AGS: Fixed StrUtil::StringToFloat()

From upstream 6942e5dde0cbc82e7870d7652c3f49095f4c641b
This commit is contained in:
Paul Gilbert 2022-04-27 20:52:45 -07:00
parent 68e5184afa
commit d6cf666e42

View File

@ -65,7 +65,7 @@ float StrUtil::StringToFloat(const String &s, float def_val) {
if (!s.GetCStr())
return def_val;
char *stop_ptr;
int val = strtof(s.GetCStr(), &stop_ptr);
float val = strtof(s.GetCStr(), &stop_ptr);
return (stop_ptr == s.GetCStr() + s.GetLength()) ? val : def_val;
}