Code

src/liboping.c: Fix an incorrect assertion in `ping_timeval_add'.
authorFlorian Forster <octo@leeloo.lan.home.verplant.org>
Tue, 17 Feb 2009 08:17:03 +0000 (09:17 +0100)
committerFlorian Forster <octo@leeloo.lan.home.verplant.org>
Tue, 17 Feb 2009 08:17:03 +0000 (09:17 +0100)
src/liboping.c

index c93633c8ea7c6cfba58336f394a4d4c9b1c7019e..02125e26c325a443d7a38976e4931f085199239e 100644 (file)
@@ -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)
        {