From aefe2f85ab16d3914bdc252fe4321e382ee227e7 Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Sun, 30 Apr 2017 14:36:21 +0200 Subject: [PATCH] cJSONUtils_PatchDetach -> detach_path --- cJSON_Utils.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cJSON_Utils.c b/cJSON_Utils.c index 12f30c5..1f8caf8 100644 --- a/cJSON_Utils.c +++ b/cJSON_Utils.c @@ -356,7 +356,8 @@ static cJSON *detach_item_from_array(cJSON *array, size_t which) return c; } -static cJSON *cJSONUtils_PatchDetach(cJSON *object, const unsigned char *path) +/* detach an item at the given path */ +static cJSON *detach_path(cJSON *object, const unsigned char *path) { unsigned char *parent_pointer = NULL; unsigned char *child_pointer = NULL; @@ -685,7 +686,7 @@ static int cJSONUtils_ApplyPatch(cJSON *object, const cJSON *patch) if ((opcode == REMOVE) || (opcode == REPLACE)) { /* Get rid of old. */ - cJSON *old_item = cJSONUtils_PatchDetach(object, (unsigned char*)path->valuestring); + cJSON *old_item = detach_path(object, (unsigned char*)path->valuestring); if (old_item == NULL) { status = 13; @@ -713,7 +714,7 @@ static int cJSONUtils_ApplyPatch(cJSON *object, const cJSON *patch) if (opcode == MOVE) { - value = cJSONUtils_PatchDetach(object, (unsigned char*)from->valuestring); + value = detach_path(object, (unsigned char*)from->valuestring); } if (opcode == COPY) {