reformatting: cJSONUtils_PointerEncodedstrcpy

This commit is contained in:
Max Bruckner committed 2016-10-13 23:47:40 +07:00
1 parent 3f6716e63a
commit 7771225e35
1 file changed
+16 -4
+16 -4
View File
@@ -79,11 +79,23 @@ static void cJSONUtils_PointerEncodedstrcpy(char *d,const char *s)
{ {
for (; *s; s++) for (; *s; s++)
{ {
if (*s=='/') {*d++='~';*d++='1';} if (*s == '/')
else if (*s=='~') {*d++='~';*d++='0';} {
else *d++=*s; *d++ = '~';
*d++ = '1';
} }
*d=0; else if (*s == '~')
{
*d++ = '~';
*d++ = '0';
}
else
{
*d++ = *s;
}
}
*d = '\0';
} }
char *cJSONUtils_FindPointerFromObjectTo(cJSON *object,cJSON *target) char *cJSONUtils_FindPointerFromObjectTo(cJSON *object,cJSON *target)