microbit: BUGFIX Corrected length calculation for validation case
Incorreclty calculated payload bug also addressed here.
This commit is contained in:
parent
5cb265c158
commit
9d039fd9be
1 changed files with 1 additions and 1 deletions
|
@ -39,7 +39,7 @@ int MicroBitRadioDatagram::recv(uint8_t *buf, int len)
|
|||
PacketBuffer *p = rxQueue;
|
||||
rxQueue = rxQueue->next;
|
||||
|
||||
int l = min(len, p->length - MICROBIT_RADIO_HEADER_SIZE - 1);
|
||||
int l = min(len, p->length - (MICROBIT_RADIO_HEADER_SIZE - 1));
|
||||
|
||||
// Fill in the buffer provided, if possible.
|
||||
memcpy(buf, p->payload, l);
|
||||
|
|
Loading…
Reference in a new issue