mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-24 02:42:55 +00:00
effectively revert 36e1687e0e
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
5f2f6e9779
commit
bfa8ffeee5
1 changed files with 10 additions and 2 deletions
|
@ -2418,6 +2418,16 @@ double QLocalePrivate::bytearrayToDouble(const char *num, bool *ok)
|
|||
return 0.0;
|
||||
}
|
||||
|
||||
// strtod() sets errno to ERANGE on nan/infinity
|
||||
if (ok != Q_NULLPTR)
|
||||
*ok = true;
|
||||
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;
|
||||
Q_RESET_ERRNO
|
||||
double ret = std::strtod(num, &endptr);
|
||||
|
@ -2434,8 +2444,6 @@ double QLocalePrivate::bytearrayToDouble(const char *num, bool *ok)
|
|||
return 0.0;
|
||||
}
|
||||
|
||||
if (ok != Q_NULLPTR)
|
||||
*ok = true;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue