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>
avl_insert(&remote_hosts, &host->avl);
out:
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);
return host;
free(host->addr);