mirror of
https://github.com/DaveGamble/cJSON.git
synced 2023-08-10 21:13:26 +03:00
reformatting: cJSONUtils_ApplyPatches
This commit is contained in:
parent
d883f9b9b0
commit
e8a67f0e4b
@ -458,16 +458,27 @@ static int cJSONUtils_ApplyPatch(cJSON *object, cJSON *patch)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int cJSONUtils_ApplyPatches(cJSON *object,cJSON *patches)
|
int cJSONUtils_ApplyPatches(cJSON *object, cJSON *patches)
|
||||||
{
|
{
|
||||||
int err;
|
int err;
|
||||||
if (patches->type!=cJSON_Array) return 1; /* malformed patches. */
|
if (patches->type != cJSON_Array)
|
||||||
if (patches) patches=patches->child;
|
{
|
||||||
|
/* malformed patches. */
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
if (patches)
|
||||||
|
{
|
||||||
|
patches = patches->child;
|
||||||
|
}
|
||||||
while (patches)
|
while (patches)
|
||||||
{
|
{
|
||||||
if ((err=cJSONUtils_ApplyPatch(object,patches))) return err;
|
if ((err = cJSONUtils_ApplyPatch(object, patches)))
|
||||||
patches=patches->next;
|
{
|
||||||
|
return err;
|
||||||
}
|
}
|
||||||
|
patches = patches->next;
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user