From: Lars-Peter Clausen Date: Sat, 21 Aug 2010 00:51:48 +0000 (+0200) Subject: ucimap: ucimap_parse: consider smap_offset when allocating the section data X-Git-Url: http://pilppa.org/gitweb/?p=uci.git;a=commitdiff_plain;h=25f9dbfe7bba18ac6c9b2f31e55c19be57f4eee0 ucimap: ucimap_parse: consider smap_offset when allocating the section data 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 --- diff --git a/ucimap.c b/ucimap.c index 9853e7e..7c4fb02 100644 --- 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;