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:
2
remote.c
2
remote.c
@@ -213,7 +213,7 @@ interface_get_host(const char *addr, unsigned long id)
|
|||||||
avl_insert(&remote_hosts, &host->avl);
|
avl_insert(&remote_hosts, &host->avl);
|
||||||
|
|
||||||
out:
|
out:
|
||||||
if (host->addr && strcmp(host->addr, addr) != 0)
|
if (host->addr && !strcmp(host->addr, addr))
|
||||||
return host;
|
return host;
|
||||||
|
|
||||||
free(host->addr);
|
free(host->addr);
|
||||||
|
Reference in New Issue
Block a user