Skip to content

Commit 670af70

Browse files
committed
dns_sd: qualify IIO_ERROR message before it prints out
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]>
1 parent d2b9ff6 commit 670af70

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

dns_sd.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ static void dnssd_remove_node(struct dns_sd_discovery_data **ddata, int n)
5353
ldata = ndata;
5454
i++;
5555
}
56-
IIO_ERROR("dnssd_remove_node call when %i exceeds list length (%i)\n", n, i);
56+
if (i < n)
57+
IIO_ERROR("dnssd_remove_node call when %i exceeds list length (%i)\n", n, i);
5758
}
5859

5960
*ddata = d;

0 commit comments

Comments
 (0)