Revert "Allow generic_read_string to terminate on expected_len"

This reverts commit 00b6e0ecd7.
pull/1330/head
Mike Black W9MDB 2023-05-27 15:13:22 -05:00
rodzic 08abfbe19a
commit 4ae3519c4e
1 zmienionych plików z 2 dodań i 1 usunięć

Wyświetl plik

@ -1336,11 +1336,12 @@ static int read_string_generic(hamlib_port_t *p,
memset(rxbuffer, 0, rxmax); memset(rxbuffer, 0, rxmax);
short timeout_retries = p->timeout_retry; short timeout_retries = p->timeout_retry;
while ( total_count < expected_len && total_count < rxmax - 1) // allow 1 byte for end-of-string while (total_count < rxmax - 1) // allow 1 byte for end-of-string
{ {
ssize_t rd_count = 0; ssize_t rd_count = 0;
int result; int result;
result = port_wait_for_data(p, direct); result = port_wait_for_data(p, direct);
if (result == -RIG_ETIMEOUT) if (result == -RIG_ETIMEOUT)
{ {
if (timeout_retries > 0) if (timeout_retries > 0)