diff --git a/testing/drivertest/drivertest_uart.c b/testing/drivertest/drivertest_uart.c index d26d07005cf..093d002c375 100644 --- a/testing/drivertest/drivertest_uart.c +++ b/testing/drivertest/drivertest_uart.c @@ -226,7 +226,7 @@ static void read_default(FAR void **state) while (cnt < sizeof(DEFAULT_CONTENT) - 1) { - ssize_t n = read(test_state->fd, buffer + cnt, buffer_size - cnt); + ssize_t n = read(test_state->fd, buffer + cnt, buffer_size - cnt - 1); assert_true(n >= 0); if (n == 0)