Commit 73cf59c1 authored by TMRh20's avatar TMRh20

Fix: RPi memory corruption

- Per #46 the read_payload() function was over-reading data into the
user provided buffer
parent 6bf37cdf
......@@ -308,9 +308,11 @@ uint8_t RF24::read_payload(void* buf, uint8_t data_len)
status = *prx++; // 1st byte is status
while ( --size ) // Decrement before to skip 1st status byte
while ( --data_len ) // Decrement before to skip 1st status byte
*current++ = *prx++;
*current = *prx;
#elif defined (__arm__) && !defined ( CORE_TEENSY )
status = _SPI.transfer(csn_pin, R_RX_PAYLOAD, SPI_CONTINUE );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment