mirror of
https://github.com/libretro/RetroArch
synced 2025-01-30 21:32:45 +00:00
Avoid strtof() since it's C99/POSIX. Go for strtod followed by float
cast since it should be almost identical
This commit is contained in:
parent
16930150f8
commit
02df727cb2
@ -1063,11 +1063,8 @@ int setting_set_with_string_representation(rarch_setting_t* setting,
|
||||
}
|
||||
break;
|
||||
case ST_FLOAT:
|
||||
#if defined(_MSC_VER) && _MSC_VER < 1800
|
||||
sscanf(value, "%f", setting->value.target.fraction);
|
||||
#else
|
||||
*setting->value.target.fraction = strtof(value, &ptr);
|
||||
#endif
|
||||
/* strtof() is C99/POSIX. Just use the more portable kind. */
|
||||
*setting->value.target.fraction = (float)strtod(value, &ptr);
|
||||
if (flags & SD_FLAG_HAS_RANGE)
|
||||
{
|
||||
if (setting->enforce_minrange && *setting->value.target.fraction < min)
|
||||
|
Loading…
x
Reference in New Issue
Block a user