From 4c51602d48be0f3c52e40ed46e92c0099c533599 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Wed, 17 Nov 2010 09:01:19 +0100 Subject: [PATCH] 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! --- src/liboping.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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; -- 2.11.0