Skip to content

Commit 2226826

Browse files
authored
Fix mac cmd size retrieval
1 parent 5322dd1 commit 2226826

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lmic/lmic.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,7 @@ static CONST_TABLE(u1_t, macCmdSize)[] = {
711711
static u1_t getMacCmdSize(u1_t macCmd) {
712712
if (macCmd < 2)
713713
return 0;
714-
if (macCmd >= LENOF_TABLE(macCmdSize) - 2)
714+
if ((macCmd - 2) >= LENOF_TABLE(macCmdSize))
715715
return 0;
716716
return TABLE_GET_U1(macCmdSize, macCmd - 2);
717717
}

0 commit comments

Comments
 (0)