From 7771225e35370f0e208f8cc2de2a9b9d0c9d5060 Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Thu, 13 Oct 2016 23:47:40 +0700 Subject: [PATCH] reformatting: cJSONUtils_PointerEncodedstrcpy --- cJSON_Utils.c | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/cJSON_Utils.c b/cJSON_Utils.c index f816948..13bd463 100644 --- a/cJSON_Utils.c +++ b/cJSON_Utils.c @@ -75,15 +75,27 @@ static int cJSONUtils_PointerEncodedstrlen(const char *s) return l; } -static void cJSONUtils_PointerEncodedstrcpy(char *d,const char *s) +static void cJSONUtils_PointerEncodedstrcpy(char *d, const char *s) { - for (;*s;s++) - { - if (*s=='/') {*d++='~';*d++='1';} - else if (*s=='~') {*d++='~';*d++='0';} - else *d++=*s; - } - *d=0; + for (; *s; s++) + { + if (*s == '/') + { + *d++ = '~'; + *d++ = '1'; + } + else if (*s == '~') + { + *d++ = '~'; + *d++ = '0'; + } + else + { + *d++ = *s; + } + } + + *d = '\0'; } char *cJSONUtils_FindPointerFromObjectTo(cJSON *object,cJSON *target)