From ee942591caab3ded1222012d865605a66af17cc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Sat, 30 Aug 2014 23:25:54 +0200 Subject: [PATCH] JSON parser: Fixed increasing position after constants. The first letter is already increased by the main parse loop. --- src/kits/shared/Json.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/kits/shared/Json.cpp b/src/kits/shared/Json.cpp index 3e4a1461eb..df8506aef1 100644 --- a/src/kits/shared/Json.cpp +++ b/src/kits/shared/Json.cpp @@ -371,7 +371,9 @@ BJson::_ParseConstant(BString& JSON, int32& pos, const char* constant) BString value; JSON.CopyInto(value, pos, strlen(constant)); if (value == constant) { - pos += strlen(constant); + // Increase pos by the remainder of the constant, pos will be + // increased for the first letter in the main parse loop. + pos += strlen(constant) - 1; return true; } else return false;