Skip to content

Commit

Permalink
tests/drivers/at: fix device table overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
krzysztof-cabaj committed Oct 26, 2023
1 parent 2b9e828 commit a32dbbf
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/drivers/at/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ static int init(int argc, char **argv)
uint8_t uart = atoi(argv[1]);
uint32_t baudrate = atoi(argv[2]);

if (uart >= UART_NUMOF) {
printf("Wrong UART device number - should be in range 0-%d.\n", UART_NUMOF - 1);
return 1;
}

int res = at_dev_init(&at_dev, UART_DEV(uart), baudrate, buf, sizeof(buf));

/* check the UART initialization return value and respond as needed */
Expand Down

0 comments on commit a32dbbf

Please sign in to comment.