From: Florian Forster Date: Wed, 17 Nov 2010 08:01:19 +0000 (+0100) Subject: src/liboping.c: Always set the QoS member. Default to 0. X-Git-Tag: liboping-1.5.1~3 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=4c51602d48be0f3c52e40ed46e92c0099c533599;p=liboping.git src/liboping.c: Always set the QoS member. Default to 0. This should fix the following warning / error: liboping.c:599: warning: comparison is always true due to limited range of data type Thanks to James Bromberger for reporting this! --- diff --git a/src/liboping.c b/src/liboping.c index a272e2c..4616843 100644 --- a/src/liboping.c +++ b/src/liboping.c @@ -499,7 +499,7 @@ static int ping_receive_one (pingobj_t *obj, const pinghost_t *ph, /* Iterate over all auxiliary data in msghdr */ recv_ttl = -1; - recv_qos = 0xff; + recv_qos = 0; for (cmsg = CMSG_FIRSTHDR (&msghdr); /* {{{ */ cmsg != NULL; cmsg = CMSG_NXTHDR (&msghdr, cmsg)) @@ -596,8 +596,7 @@ static int ping_receive_one (pingobj_t *obj, const pinghost_t *ph, if (recv_ttl >= 0) host->recv_ttl = recv_ttl; - if (recv_qos != 0xffff) - host->recv_qos = recv_qos; + host->recv_qos = recv_qos; host->latency = ((double) diff.tv_usec) / 1000.0; host->latency += ((double) diff.tv_sec) * 1000.0;