From cdd2892007db685207ad524d0e8d85cf1fc5beb8 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Wed, 12 Dec 2012 19:18:40 +0100 Subject: [PATCH] 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 --- qmljs_runtime.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qmljs_runtime.cpp b/qmljs_runtime.cpp index 55258fd..25a3c11 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 -- 2.7.4