]> pilppa.com Git - uci.git/commitdiff
ucimap: ucimap_parse: consider smap_offset when allocating the section data
authorLars-Peter Clausen <lars@metafoo.de>
Sat, 21 Aug 2010 00:51:48 +0000 (02:51 +0200)
committerFelix Fietkau <nbd@openwrt.org>
Sat, 21 Aug 2010 01:31:30 +0000 (03:31 +0200)
Currently when there is no custom section data allocator the ucimap_section_data
struct has to be at the beginning at the containing structure.
This patch gets rid of that restriction by taking smap_offset into account.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
ucimap.c

index 9853e7e89fb337207cd122d486da68ce1c912722..7c4fb0240790aeb6c2386aa8c7deed8824bfda6d 100644 (file)
--- a/ucimap.c
+++ b/ucimap.c
@@ -884,6 +884,7 @@ ucimap_parse(struct uci_map *map, struct uci_package *pkg)
                        } else {
                                sd = malloc(sm->alloc_len);
                                memset(sd, 0, sm->alloc_len);
+                               sd = ucimap_ptr_section(sm, sd);
                        }
                        if (!sd)
                                continue;