From 284562c010bb9b95b66c92ac7b6389f4a95ec5ab Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Tue, 17 Feb 2009 09:17:03 +0100 Subject: [PATCH] src/liboping.c: Fix an incorrect assertion in `ping_timeval_add'. --- src/liboping.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/liboping.c b/src/liboping.c index c93633c..02125e2 100644 --- a/src/liboping.c +++ b/src/liboping.c @@ -162,7 +162,6 @@ static int ping_timeval_add (struct timeval *tv1, struct timeval *tv2, static int ping_timeval_sub (struct timeval *tv1, struct timeval *tv2, struct timeval *res) { - if ((tv1->tv_sec < tv2->tv_sec) || ((tv1->tv_sec == tv2->tv_sec) && (tv1->tv_usec < tv2->tv_usec))) @@ -171,7 +170,7 @@ static int ping_timeval_sub (struct timeval *tv1, struct timeval *tv2, res->tv_sec = tv1->tv_sec - tv2->tv_sec; res->tv_usec = tv1->tv_usec - tv2->tv_usec; - assert ((res->tv_sec > 0) || ((res->tv_sec == 0) && (res->tv_usec > 0))); + assert ((res->tv_sec > 0) || ((res->tv_sec == 0) && (res->tv_usec >= 0))); while (res->tv_usec < 0) { -- 2.30.2