From: David Bauer Date: Sun, 5 Sep 2021 16:03:21 +0000 (+0200) Subject: remote: fix incorrect use of strcmp result X-Git-Url: http://git.openwrt.org/?a=commitdiff_plain;h=bee7c7e0dfdf741010258e3dbd6fe1521efec326;p=project%2Fusteer.git 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 --- diff --git a/remote.c b/remote.c index 38239ba..8e6e37e 100644 --- a/remote.c +++ b/remote.c @@ -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);