remote: fix incorrect use of strcmp result

When checking if the hostaddresses match up, the result returned from
strcmp was incorrectly evaluated. strcmp returns 0 in case both strings
match.

Signed-off-by: David Bauer <mail@david-bauer.net>
This commit is contained in:
David Bauer
2021-09-05 18:03:21 +02:00
parent 54f726f68b
commit bee7c7e0df

View File

@@ -213,7 +213,7 @@ interface_get_host(const char *addr, unsigned long id)
avl_insert(&remote_hosts, &host->avl);
out:
if (host->addr && strcmp(host->addr, addr) != 0)
if (host->addr && !strcmp(host->addr, addr))
return host;
free(host->addr);