From bee7c7e0dfdf741010258e3dbd6fe1521efec326 Mon Sep 17 00:00:00 2001 From: David Bauer Date: Sun, 5 Sep 2021 18:03:21 +0200 Subject: [PATCH] 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 --- remote.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- 2.30.2