From a21a124d404ec8727f4d7663febec65951831b51 Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Sat, 15 Oct 2016 12:20:47 +0700 Subject: [PATCH] reformatting: cJSONUtils_InplaceDecodePointerString --- cJSON_Utils.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/cJSON_Utils.c b/cJSON_Utils.c index afbb593..5658563 100644 --- a/cJSON_Utils.c +++ b/cJSON_Utils.c @@ -192,9 +192,17 @@ cJSON *cJSONUtils_GetPointer(cJSON *object, const char *pointer) /* JSON Patch implementation. */ static void cJSONUtils_InplaceDecodePointerString(char *string) { - char *s2=string; - for (;*string;s2++,string++) *s2=(*string!='~')?(*string):((*(++string)=='0')?'~':'/'); - *s2=0; + char *s2 = string; + for (; *string; s2++, string++) + { + *s2 = (*string != '~') + ? (*string) + : ((*(++string) == '0') + ? '~' + : '/'); + } + + *s2 = '\0'; } static cJSON *cJSONUtils_PatchDetach(cJSON *object,const char *path)