| 760 | cJSON_Delete(c); |
| 761 | } |
| 762 | void cJSON_ReplaceItemInObject(cJSON *object, const char *string, cJSON *newitem) { |
| 763 | int i = 0; |
| 764 | cJSON *c = object->child; |
| 765 | while (c && cJSON_strcasecmp(c->string, string)) i++, c = c->next; |
| 766 | if (c) { |
| 767 | newitem->string = cJSON_strdup(string); |
| 768 | cJSON_ReplaceItemInArray(object, i, newitem); |
| 769 | } |
| 770 | } |
| 771 | |
| 772 | /* Create basic types: */ |
| 773 | cJSON *cJSON_CreateNull() { |
no test coverage detected