do not handle NAN and INFINITY explicitly in QLocalePrivate::bytearrayToDouble()

std::strtod() should support such cases, even case-insensitive occurences

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2020-11-26 17:18:56 +00:00
parent 5717bc5056
commit 36e1687e0e

View file

@ -2731,15 +2731,6 @@ double QLocalePrivate::bytearrayToDouble(const char *num, bool *ok, bool *overfl
return 0.0;
}
if (qstrcmp(num, "nan") == 0)
return qSNaN();
if (qstrcmp(num, "+inf") == 0 || qstrcmp(num, "inf") == 0)
return qInf();
if (qstrcmp(num, "-inf") == 0)
return -qInf();
char *endptr;
double ret = std::strtod(num, &endptr);
if ((ret == 0.0l && errno == ERANGE) || ret == HUGE_VAL || ret == -HUGE_VAL) {