if (!target)
return -1;
- *data->data = target;
+ data->ptr = target;
for (i = 0; i < 4; i++)
target[i] = (char) tmp[i];
network_format_ip(void *section, struct uci_optmap *om, union ucimap_data *data, char **str)
{
static char buf[16];
- unsigned char *ip = (unsigned char *) data->data[0];
+ unsigned char *ip = (unsigned char *) data->ptr;
if (ip) {
sprintf(buf, "%d.%d.%d.%d", ip[0], ip[1], ip[2], ip[3]);
ucimap_add_fixup(sd, data, om, str);
return;
case UCIMAP_CUSTOM:
- tdata.s = (char *) data;
break;
}
if (om->parse) {
- if (om->parse(ucimap_section_ptr(sd), om, &tdata, str) < 0)
+ if (om->parse(ucimap_section_ptr(sd), om, data, str) < 0)
return;
if (ucimap_is_custom(om->type) && om->free) {
if (tdata.ptr != data->ptr)
}
if (om->format) {
- union ucimap_data tdata;
-
- if (ucimap_is_custom(om->type)) {
- tdata.s = (char *)data;
- data = &tdata;
- }
-
if (om->format(ucimap_section_ptr(sd), om, data, &str) < 0)
return NULL;