From 32ca7ad706d3df7e19e07fff69f8e5fa3413e72f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Igor=20Mi=C5=A1i=C4=87?= Date: Fri, 22 Jul 2022 10:25:55 +0200 Subject: [PATCH] serial_test: fix write for max buffer size --- src/systemcmds/serial_test/serial_test.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/systemcmds/serial_test/serial_test.c b/src/systemcmds/serial_test/serial_test.c index c5d4d14c9f..f2b21607f2 100644 --- a/src/systemcmds/serial_test/serial_test.c +++ b/src/systemcmds/serial_test/serial_test.c @@ -574,7 +574,6 @@ static void process_read_data(struct g_mod_t *g_mod, struct cli_args_t *g_cl) static void process_write_data(struct g_mod_t *g_mod, struct cli_args_t *g_cl) { ssize_t count = 0; - int loops = 10; int repeat = (g_cl->_tx_bytes == 0); do { @@ -594,13 +593,11 @@ static void process_write_data(struct g_mod_t *g_mod, struct cli_args_t *g_cl) c = 0; - } else { - loops--; } count += c; - if (loops == 0 || c < g_mod->_write_size) { + if (c <= g_mod->_write_size) { g_mod->_write_count_value = g_mod->_write_data[c]; repeat = 0; }