]> pilppa.org Git - uci.git/blobdiff - ucimap-example.c
fix possible uninitialized warning from gcc 4.92
[uci.git] / ucimap-example.c
index 9b315d0a193bcccf51be4f94fe6240bd63b46961..e04c66ddcc6b647ffc704d3e47590634854424f0 100644 (file)
@@ -56,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];
 
@@ -67,7 +67,7 @@ static int
 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]);