1
0
mirror of git://sigrok.org/libserialport synced 2023-08-10 21:13:24 +03:00

windows: restart_wait_if_needed(): Skip buffer check if no bytes read.

This commit is contained in:
Martin Ling 2015-05-06 20:15:46 +01:00 committed by Uwe Hermann
parent 94a314a806
commit 21ae5ce197

View File

@ -923,6 +923,9 @@ static enum sp_return restart_wait_if_needed(struct sp_port *port, unsigned int
{
int ret, bytes_remaining;
if (bytes_read == 0)
RETURN_OK();
ret = sp_input_waiting(port);
if (ret < 0)
@ -930,7 +933,7 @@ static enum sp_return restart_wait_if_needed(struct sp_port *port, unsigned int
bytes_remaining = ret;
if (bytes_read > 0 && bytes_remaining == 0)
if (bytes_remaining == 0)
TRY(restart_wait(port));
RETURN_OK();