summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2020-08-28 09:26:49 +0200
committerEdward Welbourne <edward.welbourne@qt.io>2020-09-22 19:08:53 +0200
commit92a9a18b5d95b7d3d3fc2d3bb75bea58bd5c6878 (patch)
tree4b17cc020351acba39015e7796be5b824bbcc86f
parentdf276fb29fc85e5ae6a552e9d8e8da6509425102 (diff)
Count digits in QDateTimeParser::parseSection()'s numeric fields
Assuming everything up to the first space is a digit is not sound. Change-Id: Iab5bb134c8e3299da726625c53b6a9b23f09dbb4 Reviewed-by: Andreas Buhr <andreas.buhr@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
-rw-r--r--src/corelib/time/qdatetimeparser.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/time/qdatetimeparser.cpp b/src/corelib/time/qdatetimeparser.cpp
index efc8ea70d7..f302651884 100644
--- a/src/corelib/time/qdatetimeparser.cpp
+++ b/src/corelib/time/qdatetimeparser.cpp
@@ -816,7 +816,7 @@ QDateTimeParser::parseSection(const QDateTime &currentValue, int sectionIndex,
result = ParsedSection(Intermediate);
} else {
for (int i = 0; i < sectiontextSize; ++i) {
- if (sectionTextRef.at(i).isSpace())
+ if (!sectionTextRef.at(i).isDigit())
sectiontextSize = i; // which exits the loop
}