JSON parser: Fixed increasing position after constants.

The first letter is already increased by the main parse loop.
This commit is contained in:
Stephan Aßmus
2014-08-30 23:42:03 +02:00
parent ffd7c6110b
commit ee942591ca
+3 -1
View File
@@ -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;