From ebd16975d01b3a2200e94e164199b88527a27e3c Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Sun, 22 Sep 2013 11:30:37 +0200 Subject: [PATCH] An even number of bytes is when modulo 2 is zero, not modulo 1 is one. --- src/drivers/px4io/px4io.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/drivers/px4io/px4io.cpp b/src/drivers/px4io/px4io.cpp index f9fb9eea96..aca411b1e5 100644 --- a/src/drivers/px4io/px4io.cpp +++ b/src/drivers/px4io/px4io.cpp @@ -1509,7 +1509,7 @@ PX4IO::mixer_send(const char *buf, unsigned buflen, unsigned retries) * even. */ unsigned total_len = sizeof(px4io_mixdata) + count; - if (total_len % 1) { + if (total_len % 2) { msg->text[count] = '\0'; total_len++; }