mirror of
https://github.com/bblanchon/ArduinoJson.git
synced 2025-07-18 04:52:22 +02:00
Fixed the bug in getNestedTokenCount()
This commit is contained in:
@ -11,10 +11,12 @@
|
|||||||
int JsonObjectBase::getNestedTokenCount(jsmntok_t* token)
|
int JsonObjectBase::getNestedTokenCount(jsmntok_t* token)
|
||||||
{
|
{
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
jsmntok_t* nextSibling = token + 1;
|
||||||
|
|
||||||
for (int i = 0; i < token->size; i++)
|
while (nextSibling->start < token->end)
|
||||||
{
|
{
|
||||||
count += 1 + getNestedTokenCount(token + 1 + i);
|
nextSibling++;
|
||||||
|
count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
return count;
|
return count;
|
||||||
|
Reference in New Issue
Block a user