Skip to content

Commit e80be06

Browse files
Extend the correct_start guard
1 parent f34cbe7 commit e80be06

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

libcanard/canard.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -867,7 +867,9 @@ CANARD_PRIVATE int8_t rxSessionUpdate(CanardInstance* const ins,
867867
const bool correct_transport = (rxs->redundant_transport_index == redundant_transport_index);
868868
const bool correct_toggle = (frame->toggle == rxs->toggle);
869869
const bool correct_tid = (frame->transfer_id == rxs->transfer_id);
870-
const bool correct_start = frame->start_of_transfer || (rxs->total_payload_size > 0);
870+
const bool correct_start = frame->start_of_transfer //
871+
? (rxs->total_payload_size == 0)
872+
: (rxs->total_payload_size > 0);
871873
if (correct_transport && correct_toggle && correct_tid && correct_start)
872874
{
873875
out = rxSessionAcceptFrame(ins, rxs, frame, extent, out_transfer);

0 commit comments

Comments
 (0)