summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2020-07-24 10:31:02 -0700
committerThiago Macieira <thiago.macieira@intel.com>2020-07-28 08:54:06 -0700
commitf16613f7ef34769181ac19a45b5c42059e63572f (patch)
tree66413d39a8bbadf15768d8063405a3b1abbfe9f4 /src
parentf50945b8fd6f51bf679ef35153915da882f332de (diff)
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>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/text/qlocale_tools.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/text/qlocale_tools.cpp b/src/corelib/text/qlocale_tools.cpp
index c902c14659..4e43d7d29b 100644
--- a/src/corelib/text/qlocale_tools.cpp
+++ b/src/corelib/text/qlocale_tools.cpp
@@ -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;