Skip to content

Commit

Permalink
Allow generic_read_string to terminate on expected_len
Browse files Browse the repository at this point in the history
  • Loading branch information
mdblack98 committed May 27, 2023
1 parent 77d9d11 commit 00b6e0e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/iofunc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1336,12 +1336,11 @@ static int read_string_generic(hamlib_port_t *p,
memset(rxbuffer, 0, rxmax);

short timeout_retries = p->timeout_retry;
while (total_count < rxmax - 1) // allow 1 byte for end-of-string
while ( total_count < expected_len && total_count < rxmax - 1) // allow 1 byte for end-of-string
{
ssize_t rd_count = 0;
int result;
result = port_wait_for_data(p, direct);

if (result == -RIG_ETIMEOUT)
{
if (timeout_retries > 0)
Expand Down

1 comment on commit 00b6e0e

@Tyrbiter
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change appears to stop all communication between my TS-890 and freedv, unsure if WSJTX has the same problem with my IC-7300.

Please sign in to comment.