QLocale: fix conversion of "\0" to double

That is not a valid conversion. An empty string is a valid conversion; a
string containing a null should fail.

Change-Id: Iea47e0f8fc8b40378df7fffd1624c088f3bd1b14
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This commit is contained in:
Thiago Macieira 2020-07-24 10:31:02 -07:00
parent f50945b8fd
commit f16613f7ef

View File

@ -286,7 +286,7 @@ double qt_asciiToDouble(const char *num, int numLen, bool &ok, int &processed,
return needleLen == haystackLen && memcmp(needle, haystack, haystackLen) == 0;
};
if (*num == '\0') {
if (numLen == 0) {
ok = false;
processed = 0;
return 0.0;