Skip to content

Commit

Permalink
legacy_apps: test: fix bad array index in rpmsg-nocopy-echo
Browse files Browse the repository at this point in the history
The buff_list array contains MAX_NB_TX_BUFF elements.
The last element is at index (MAX_NB_TX_BUFF - 1).

Signed-off-by: Arnaud Pouliquen <[email protected]>
  • Loading branch information
arnopo committed Oct 25, 2024
1 parent c6d4e71 commit c906c0d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/legacy_apps/tests/msg/rpmsg-nocopy-echo.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ int app(struct rpmsg_device *rdev, void *priv)
LPERROR("Failed to get payload...\r\n");
break;
}
if (tx_msg == buff_list[MAX_NB_TX_BUFF]) {
if (tx_msg == buff_list[MAX_NB_TX_BUFF - 1]) {
LPERROR("error: got the lost buffer\r\n");
break;
}
Expand Down

0 comments on commit c906c0d

Please sign in to comment.