mirror of
https://github.com/DaveGamble/cJSON.git
synced 2023-08-10 21:13:26 +03:00
reformatting: cJSONUtils_PointerEncodedstrcpy
This commit is contained in:
parent
3f6716e63a
commit
7771225e35
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user