Commit a1d346a9 authored by mz-fuzzy's avatar mz-fuzzy

avoid memory corruption when calling RF24::read(0) on linux machines

Signed-off-by: default avatarmz-fuzzy <mzfuzzy800@gmail.com>
parent 137031e1
...@@ -290,10 +290,12 @@ uint8_t RF24::read_payload(void* buf, uint8_t data_len) ...@@ -290,10 +290,12 @@ uint8_t RF24::read_payload(void* buf, uint8_t data_len)
status = *prx++; // 1st byte is status status = *prx++; // 1st byte is status
if (data_len > 0) {
while ( --data_len ) // Decrement before to skip 1st status byte while ( --data_len ) // Decrement before to skip 1st status byte
*current++ = *prx++; *current++ = *prx++;
*current = *prx; *current = *prx;
}
endTransaction(); endTransaction();
#else #else
......
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