From: Florian Forster Date: Tue, 17 Feb 2009 08:17:03 +0000 (+0100) Subject: src/liboping.c: Fix an incorrect assertion in `ping_timeval_add'. X-Git-Tag: liboping-1.0.0~14 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=284562c010bb9b95b66c92ac7b6389f4a95ec5ab;p=liboping.git src/liboping.c: Fix an incorrect assertion in `ping_timeval_add'. --- 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) {