util: switch to a check for isnormal for safe_atod

Effectively the same check as before but this should also encompass
FP_SUBNORMAL.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2018-08-10 10:50:39 +10:00
parent e73f6a3899
commit c875de4626

View file

@ -571,7 +571,7 @@ safe_atod(const char *str, double *val)
return false;
if (*str != '\0' && *endptr != '\0')
return false;
if (isnan(v) || isinf(v))
if (v != 0.0 && !isnormal(v))
return false;
*val = v;