Skip to content

Commit

Permalink
lwip: Use modulo operator for mbox
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryzee119 authored and Ernegien committed Nov 25, 2024
1 parent 91d4e7f commit f133d5c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/net/nforceif/src/sys_arch.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ sys_mbox_post(struct sys_mbox **mb, void *msg)
sys_arch_sem_wait(&mbox->write_sem, 0);

sys_arch_sem_wait(&mbox->mutex, 0);
mbox->msgs[mbox->last & SYS_MBOX_SIZE] = msg;
mbox->msgs[mbox->last % SYS_MBOX_SIZE] = msg;
mbox->last++;
sys_sem_signal(&mbox->mutex);

Expand Down

0 comments on commit f133d5c

Please sign in to comment.