From c337c0f22c1961d8effac22c9e499d829280e3d2 Mon Sep 17 00:00:00 2001 From: Wojtek Date: Fri, 1 Dec 2006 09:13:57 +0100 Subject: [PATCH] Fix usage of `strcasecmp' in `ping_host_remove'. The compare function needs to be checked wether it returns zero. Without this fix the first host is being removed unless it's the host being looked for. That is obviously not good nor correct. --- src/liboping.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/liboping.c b/src/liboping.c index c42b50f..f749301 100644 --- a/src/liboping.c +++ b/src/liboping.c @@ -1192,7 +1192,7 @@ int ping_host_remove (pingobj_t *obj, const char *host) while (cur != NULL) { - if (strcasecmp (host, cur->hostname)) + if (strcasecmp (host, cur->hostname) == 0) break; pre = cur; -- 2.11.0