* uci_alloc_generic allocates a new uci_element with payload
* payload is appended to the struct to save memory and reduce fragmentation
*/
* uci_alloc_generic allocates a new uci_element with payload
* payload is appended to the struct to save memory and reduce fragmentation
*/
- sprintf(buf, "cfg%02x%04x", ++s->package->n_section, hash % (1 << 16));
+ sprintf(buf, "cfg%02x%04x", s->package->n_section, hash % (1 << 16));
uci_foreach_element_safe(&p->sections, tmp, e) {
uci_free_section(uci_to_section(e));
}
uci_foreach_element_safe(&p->sections, tmp, e) {
uci_free_section(uci_to_section(e));
}
memset(ptr, 0, sizeof(struct uci_ptr));
UCI_THROW(ctx, UCI_ERR_INVAL);
done:
memset(ptr, 0, sizeof(struct uci_ptr));
UCI_THROW(ctx, UCI_ERR_INVAL);
done:
uci_add_delta(ctx, &p->delta, UCI_CMD_RENAME, ptr->section, ptr->option, ptr->value);
n = uci_strdup(ctx, ptr->value);
uci_add_delta(ctx, &p->delta, UCI_CMD_RENAME, ptr->section, ptr->option, ptr->value);
n = uci_strdup(ctx, ptr->value);
UCI_HANDLE_ERR(ctx);
UCI_ASSERT(ctx, p != NULL);
s = uci_alloc_section(p, type, NULL);
UCI_HANDLE_ERR(ctx);
UCI_ASSERT(ctx, p != NULL);
s = uci_alloc_section(p, type, NULL);
*res = s;
if (!internal && p->has_delta)
uci_add_delta(ctx, &p->delta, UCI_CMD_ADD, s->e.name, NULL, type);
*res = s;
if (!internal && p->has_delta)
uci_add_delta(ctx, &p->delta, UCI_CMD_ADD, s->e.name, NULL, type);