X-Git-Url: http://pilppa.org/gitweb/?a=blobdiff_plain;f=ucimap-example.c;h=e04c66ddcc6b647ffc704d3e47590634854424f0;hb=HEAD;hp=1b2f601742a991fb38ec739bbb7b536f70674adb;hpb=4f27765f0d0b33788e37c81958f8497f72163500;p=uci.git diff --git a/ucimap-example.c b/ucimap-example.c index 1b2f601..e04c66d 100644 --- a/ucimap-example.c +++ b/ucimap-example.c @@ -1,6 +1,6 @@ /* * ucimap-example - sample code for the ucimap library - * Copyright (C) 2008 Felix Fietkau + * Copyright (C) 2008-2009 Felix Fietkau * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 @@ -16,6 +16,7 @@ #include #include #include +#include "list.h" struct list_head ifs; @@ -55,7 +56,7 @@ network_parse_ip(void *section, struct uci_optmap *om, union ucimap_data *data, if (!target) return -1; - *data->data = target; + data->ptr = target; for (i = 0; i < 4; i++) target[i] = (char) tmp[i]; @@ -63,10 +64,10 @@ network_parse_ip(void *section, struct uci_optmap *om, union ucimap_data *data, } static int -network_format_ip(void *sction, struct uci_optmap *om, union ucimap_data *data, char **str) +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]);