diff options
author | Jeremy Friesen <jeremy.friesen@thisisant.com> | 2013-05-01 09:29:08 -0600 |
---|---|---|
committer | Jeremy Friesen <jeremy.friesen@thisisant.com> | 2013-05-01 09:29:08 -0600 |
commit | 2d96a12078c6f9131e8b3c3907b4803111197efc (patch) | |
tree | e3ae679c466315f1aec8d036262fe6f20c17401e | |
parent | e6e7a81b688c0a26c049e664fd1a856cb76b6781 (diff) | |
download | android_external_ant-wireless_ant_native-2d96a12078c6f9131e8b3c3907b4803111197efc.tar.gz android_external_ant-wireless_ant_native-2d96a12078c6f9131e8b3c3907b4803111197efc.tar.bz2 android_external_ant-wireless_ant_native-2d96a12078c6f9131e8b3c3907b4803111197efc.zip |
Fixed bug where the receiving exact number of bytes would lead to saving
-rw-r--r-- | src/vfs/ant_rx_chardev.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/vfs/ant_rx_chardev.c b/src/vfs/ant_rx_chardev.c index f15e97a..d6262e5 100644 --- a/src/vfs/ant_rx_chardev.c +++ b/src/vfs/ant_rx_chardev.c @@ -267,7 +267,7 @@ int readChannelMsg(ant_channel_type eChannel, ant_channel_info_t *pstChnlInfo) iRxLenRead += iRxBufferLength; // add existing data on // if we didn't get a full packet, then just exit - if (iRxLenRead <= (aucRxBuffer[ANT_HCI_SIZE_OFFSET] + ANT_HCI_HEADER_SIZE + ANT_HCI_FOOTER_SIZE)) { + if (iRxLenRead < (aucRxBuffer[ANT_HCI_SIZE_OFFSET] + ANT_HCI_HEADER_SIZE + ANT_HCI_FOOTER_SIZE)) { iRxBufferLength = iRxLenRead; iRet = 0; goto out; @@ -306,7 +306,7 @@ int readChannelMsg(ant_channel_type eChannel, ant_channel_info_t *pstChnlInfo) // This currently works as no size value is greater than 255, and little endian iHciDataSize = aucRxBuffer[iCurrentHciPacketOffset + ANT_HCI_SIZE_OFFSET]; - if ((iHciDataSize + ANT_HCI_HEADER_SIZE + ANT_HCI_FOOTER_SIZE + iCurrentHciPacketOffset) >= + if ((iHciDataSize + ANT_HCI_HEADER_SIZE + ANT_HCI_FOOTER_SIZE + iCurrentHciPacketOffset) > iRxLenRead) { // we don't have a whole packet iRxBufferLength = iRxLenRead - iCurrentHciPacketOffset; |