aboutsummaryrefslogtreecommitdiffstats
path: root/qmljs_runtime.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2012-12-12 19:18:40 +0100
committerSimon Hausmann <simon.hausmann@digia.com>2012-12-12 10:50:14 +0100
commitcdd2892007db685207ad524d0e8d85cf1fc5beb8 (patch)
tree371d225343a4260c57dee82d2e7fa3a52dbec101 /qmljs_runtime.cpp
parent363a7b57d87b72ffd906dfb437774a3cdb9c3bda (diff)
Fix a bug in __qmljs_string_to_number
The check whether we successfully converted the whole string was broken, leading to lots of NaN's when converting. Change-Id: Iea0c37e5900e4fe1a1d0adca9a91e76aeb544336 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'qmljs_runtime.cpp')
-rw-r--r--qmljs_runtime.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/qmljs_runtime.cpp b/qmljs_runtime.cpp
index 55258fd06d..25a3c11ec0 100644
--- a/qmljs_runtime.cpp
+++ b/qmljs_runtime.cpp
@@ -442,7 +442,7 @@ double __qmljs_string_to_number(ExecutionContext *, String *string)
const char *begin = ba.constData();
const char *end = 0;
double d = qstrtod(begin, &end, &ok);
- if (end - begin != ba.size() - 1) {
+ if (end - begin != ba.size()) {
if (ba == "Infinity")
d = INFINITY;
else