Subtract 1 from RADIOLIB_STATIC_ARRAY_SIZE
STATIC_ARRAY_SIZE is by default 256, bufferWritePos is uint8_t which has a max value of 255. The greater than is not really needed in this check.
This commit is contained in:
parent
7b348fae33
commit
c854dd9a9b
1 changed files with 1 additions and 1 deletions
|
@ -435,7 +435,7 @@ void PhysicalLayer::updateDirectBuffer(uint8_t bit) {
|
|||
|
||||
// check complete byte
|
||||
if(this->bufferBitPos == 8) {
|
||||
if(this->bufferWritePos >= RADIOLIB_STATIC_ARRAY_SIZE) {
|
||||
if(this->bufferWritePos >= RADIOLIB_STATIC_ARRAY_SIZE -1) {
|
||||
this->bufferWritePos = 0;
|
||||
}
|
||||
this->buffer[this->bufferWritePos] = Module::reflect(this->byteBuff, 8);
|
||||
|
|
Loading…
Add table
Reference in a new issue