From: Michal Sojka Date: Wed, 13 Apr 2016 14:16:23 +0000 (+0200) Subject: hout: Do not use variably sized local array X-Git-Url: http://rtime.felk.cvut.cz/gitweb/pes-rpp/rpp-test-sw.git/commitdiff_plain/45d6c17185cbc8d6e2e95f1508798a6c7581b774 hout: Do not use variably sized local array 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 --- diff --git a/rpp-test-sw/commands/cmd_hout.c b/rpp-test-sw/commands/cmd_hout.c index 47e66af..9a37e9d 100644 --- a/rpp-test-sw/commands/cmd_hout.c +++ b/rpp-test-sw/commands/cmd_hout.c @@ -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)