reformatting: cJSONUtils_GeneratePatch

This commit is contained in:
Max Bruckner 2016-10-17 17:00:46 +07:00
parent e8a67f0e4b
commit d6a6abeca0

View File

@ -493,8 +493,14 @@ static void cJSONUtils_GeneratePatch(cJSON *patches,const char *op,const char *p
cJSON_AddItemToObject(patch, "path", cJSON_CreateString(newpath));
free(newpath);
}
else cJSON_AddItemToObject(patch,"path",cJSON_CreateString(path));
if (val) cJSON_AddItemToObject(patch,"value",cJSON_Duplicate(val,1));
else
{
cJSON_AddItemToObject(patch, "path", cJSON_CreateString(path));
}
if (val)
{
cJSON_AddItemToObject(patch, "value", cJSON_Duplicate(val, 1));
}
cJSON_AddItemToArray(patches, patch);
}