mirror of
				https://github.com/eledio-devices/thirdparty-ArduinoJson.git
				synced 2025-10-31 16:14:11 +01: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