mirror of
https://codeberg.org/icewind/pms700x.git
synced 2026-06-03 18:14:11 +02:00
fix max length check
This commit is contained in:
parent
ab3f100e42
commit
98458df33d
1 changed files with 1 additions and 1 deletions
|
|
@ -218,7 +218,7 @@ impl SensorReader {
|
||||||
}
|
}
|
||||||
(3, length_low_byte) => {
|
(3, length_low_byte) => {
|
||||||
self.length = length_low_byte;
|
self.length = length_low_byte;
|
||||||
if self.length > MAX_RESPONSE_SIZE as u8 {
|
if self.length > (MAX_RESPONSE_SIZE - 4) as u8 {
|
||||||
self.byte_offset = 0;
|
self.byte_offset = 0;
|
||||||
}
|
}
|
||||||
Err(nb::Error::WouldBlock)
|
Err(nb::Error::WouldBlock)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue