From: Wojtek Date: Fri, 1 Dec 2006 08:13:57 +0000 (+0100) Subject: Fix usage of `strcasecmp' in `ping_host_remove'. X-Git-Tag: liboping-0.3.4~1 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=c337c0f22c1961d8effac22c9e499d829280e3d2;p=liboping.git 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. --- 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;