From b93aa72c4aa4fafe0d2a1e9773773122fba21618 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sat, 8 Jun 2013 23:42:05 +0200 Subject: [PATCH] fix generated code for allocating arrays --- data/gen-code.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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"; } -- 2.25.1