]> rtime.felk.cvut.cz Git - pes-rpp/rpp-test-sw.git/commitdiff
hout: Do not use variably sized local array
authorMichal Sojka <sojkam1@fel.cvut.cz>
Wed, 13 Apr 2016 14:16:23 +0000 (16:16 +0200)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Wed, 13 Apr 2016 14:16:23 +0000 (16:16 +0200)
This uses dynamic allocation, which does not work and results in an
exception in libc code. Since, we don't have the libc source, I'm not sure
what is exactly the reason.

Fixes #1579

rpp-test-sw/commands/cmd_hout.c

index 47e66af7936a2ad183f52454c961d39636bdd022..9a37e9d02f4cb71a3cd941e4f90be65774f52f2d 100644 (file)
@@ -42,9 +42,10 @@ int cmd_do_read_hout_ifbk_values(cmd_io_t *cmd_io, const struct cmd_des *des, ch
 {
        uint32_t i;
        const struct port_desc *port = &port_desc[PORT_ID_HOUTIFBK];
-       uint16_t values[port->numchn];
+       uint16_t values[6];
        int ret;
 
+       assert(ARRAY_SIZE(values) == port->numchn);
 
        ret = port->get(port, values, sizeof(values));
        if (ret < 0)