Skip to content

Commit

Permalink
dns_sd: qualify IIO_ERROR message before it prints out
Browse files Browse the repository at this point in the history
After a loop finishes (normally by a 'break;') only print out
the IIO_ERROR message if there was an error (was no 'break;').

This resolves some random message printing out:
ERROR: dnssd_remove_node call when 1 exceeds list length (1)
when doing dns-sd (iio_info -s).

Signed-off-by: Robin Getz <[email protected]>
  • Loading branch information
rgetz committed May 13, 2020
1 parent d2b9ff6 commit 670af70
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dns_sd.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ static void dnssd_remove_node(struct dns_sd_discovery_data **ddata, int n)
ldata = ndata;
i++;
}
IIO_ERROR("dnssd_remove_node call when %i exceeds list length (%i)\n", n, i);
if (i < n)
IIO_ERROR("dnssd_remove_node call when %i exceeds list length (%i)\n", n, i);
}

*ddata = d;
Expand Down

0 comments on commit 670af70

Please sign in to comment.