fix generated code for allocating arrays
authorFelix Fietkau <nbd@openwrt.org>
Sat, 8 Jun 2013 21:42:05 +0000 (23:42 +0200)
committerFelix Fietkau <nbd@openwrt.org>
Sat, 8 Jun 2013 21:42:05 +0000 (23:42 +0200)
data/gen-code.pl

index d7e5079619092b89e0790b4d98032fd8e0cf082a..71b738dffec615ab1aeacf8fe02d0408ec7e6bd5 100755 (executable)
@@ -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";
                }