mirror of
https://github.com/DaveGamble/cJSON.git
synced 2026-11-16 19:20:52 +00:00
cJSON_Utils: Fix get_item_from_pointer
Accessing nested arrays didn't work as intended.
This commit is contained in:
1 parent
9189b3322a
commit
9abe75e072
1 file changed
+6
-5
+6
-5
@@ -279,16 +279,17 @@ static cJSON *get_item_from_pointer(cJSON * const object, const char * pointer,
|
||||
{
|
||||
current_element = current_element->next;
|
||||
}
|
||||
/* skip to the next path token or end of string */
|
||||
while ((pointer[0] != '\0') && (pointer[0] != '/'))
|
||||
{
|
||||
pointer++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* skip to the next path token or end of string */
|
||||
while ((pointer[0] != '\0') && (pointer[0] != '/'))
|
||||
{
|
||||
pointer++;
|
||||
}
|
||||
}
|
||||
|
||||
return current_element;
|
||||
|
||||
Reference in new issue
Block a user