forked from Archive/PX4-Autopilot
An even number of bytes is when modulo 2 is zero, not modulo 1 is one.
This commit is contained in:
parent
cd8854e622
commit
ebd16975d0
|
@ -1509,7 +1509,7 @@ PX4IO::mixer_send(const char *buf, unsigned buflen, unsigned retries)
|
||||||
* even.
|
* even.
|
||||||
*/
|
*/
|
||||||
unsigned total_len = sizeof(px4io_mixdata) + count;
|
unsigned total_len = sizeof(px4io_mixdata) + count;
|
||||||
if (total_len % 1) {
|
if (total_len % 2) {
|
||||||
msg->text[count] = '\0';
|
msg->text[count] = '\0';
|
||||||
total_len++;
|
total_len++;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue