cJSON

mirror of Dave's cJSON
git clone git://git.thc420.xyz/cJSON
Log | Files | Refs | README | LICENSE

commit 9abe75e072050f34732a7169740989a082b65134
parent 9189b3322aa4ec038aa7311a40da633ae7a9960a
Author: Max Bruckner <max@maxbruckner.de>
Date:   Wed, 14 Jun 2017 17:20:12 +0200

cJSON_Utils: Fix get_item_from_pointer

Accessing nested arrays didn't work as intended.

Diffstat:
McJSON_Utils.c | 11++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/cJSON_Utils.c b/cJSON_Utils.c @@ -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;