Linux: Fix null ptr exception (#1025)

This commit is contained in:
tekka
2018-01-07 14:51:28 +01:00
committed by Henrik Ekblad
parent b51c77b2bf
commit 6434d2fa99
3 changed files with 3 additions and 3 deletions

View File

@@ -83,7 +83,7 @@ LOCAL uint8_t RF24_spiMultiByteTransfer(const uint8_t cmd, uint8_t* buf, uint8_t
} else {
status = *prx++; // status is 1st byte of receive buffer
// decrement before to skip status byte
while (--size) {
while (--size && (buf != NULL)) {
*buf++ = *prx++;
}
}

View File

@@ -136,7 +136,7 @@ LOCAL uint8_t RFM69_spiMultiByteTransfer(const uint8_t cmd, uint8_t* buf, uint8_
} else {
status = *prx++; // status is 1st byte of receive buffer
// decrement before to skip status byte
while (--size) {
while (--size && (buf != NULL)) {
*buf++ = *prx++;
}
}

View File

@@ -83,7 +83,7 @@ LOCAL uint8_t RFM95_spiMultiByteTransfer(const uint8_t cmd, uint8_t* buf, uint8_
} else {
status = *prx++; // status is 1st byte of receive buffer
// decrement before to skip status byte
while (--size) {
while (--size && (buf != NULL)) {
*buf++ = *prx++;
}
}