Skip to content

Commit

Permalink
cJSON_Utils: Fix get_item_from_pointer
Browse files Browse the repository at this point in the history
Accessing nested arrays didn't work as intended.
  • Loading branch information
FSMaxB committed Jun 14, 2017
1 parent 9189b33 commit 9abe75e
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions cJSON_Utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 9abe75e

Please sign in to comment.