mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-12-30 18:41:11 +00:00
fix array indexing bug in message_process_cmd
Source buffer was not being incremented properly, so the destination buffer containing message payload was always msg[0]. BUG=none TEST=tested on daisy (now keyboard protocol actually shows keys...) Signed-off-by: David Hendricks <dhendrix@chromium.org> Change-Id: If5a417291c9bff36bbeb2a87153de80300045257
This commit is contained in:
@@ -83,8 +83,8 @@ int message_process_cmd(int cmd, uint8_t *out_msg, int max_len)
|
||||
|
||||
for (i = 0; i < msg_len; i++) {
|
||||
if (need_copy)
|
||||
out_msg[i + 3] = *msg;
|
||||
sum += *msg;
|
||||
out_msg[i + 3] = msg[i];
|
||||
sum += msg[i];
|
||||
}
|
||||
out_msg[i + 3] = sum & 0xff;
|
||||
out_msg[i + 4] = MSG_PREAMBLE;
|
||||
|
||||
Reference in New Issue
Block a user