Browse Source

reformatting: cJSONUtils_InplaceDecodePointerString

Max Bruckner 8 years ago
parent
commit
a21a124d40
1 changed files with 11 additions and 3 deletions
  1. 11 3
      cJSON_Utils.c

+ 11 - 3
cJSON_Utils.c

@@ -192,9 +192,17 @@ cJSON *cJSONUtils_GetPointer(cJSON *object, const char *pointer)
 /* JSON Patch implementation. */
 /* JSON Patch implementation. */
 static void cJSONUtils_InplaceDecodePointerString(char *string)
 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)
 static cJSON *cJSONUtils_PatchDetach(cJSON *object,const char *path)