From: Felix Fietkau Date: Sat, 8 Jun 2013 21:42:05 +0000 (+0200) Subject: fix generated code for allocating arrays X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=b93aa72c4aa4fafe0d2a1e9773773122fba21618;p=oweals%2Fuqmi.git fix generated code for allocating arrays --- diff --git a/data/gen-code.pl b/data/gen-code.pl index d7e5079..71b738d 100755 --- a/data/gen-code.pl +++ b/data/gen-code.pl @@ -79,7 +79,7 @@ sub gen_tlv_parse_field($$$$) { $var_data .= $indent."\t$var\_n++;\n"; $data .= $indent."$iterator = $size;\n"; - $data .= $indent."$var = __qmi_alloc_static($iterator);\n"; + $data .= $indent."$var = __qmi_alloc_static($iterator * sizeof($var\[0]));\n"; $data .= $indent."while($iterator\-- > 0) {\n"; }