Browse Source

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 <lars@metafoo.de>
Lars-Peter Clausen 13 years ago
parent
commit
25f9dbfe7b
1 changed files with 1 additions and 0 deletions
  1. 1 0
      ucimap.c

+ 1 - 0
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;