microbit: BUGFIX: Length field of datagram receive now correct

Datagram receive code incorrectly calculated the payload length, resulting in
packets being delivered to applications that were two bytes shorter than they
should be.
This commit is contained in:
Joe Finney 2016-02-03 14:35:12 +00:00
parent 5a30b3c0b3
commit 5cb265c158

View file

@ -60,7 +60,7 @@ ManagedString MicroBitRadioDatagram::recv()
PacketBuffer *p = rxQueue;
rxQueue = rxQueue->next;
ManagedString s((const char *)p->payload, p->length - MICROBIT_RADIO_HEADER_SIZE - 1);
ManagedString s((const char *)p->payload, p->length - (MICROBIT_RADIO_HEADER_SIZE - 1));
delete p;
return s;