From: Miroslav Lichvar Date: Thu, 23 Jun 2011 11:42:04 +0000 (+0200) Subject: Add asserts for timeout delays X-Git-Tag: 1.26-pre1~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bab7ba22cfdf628e1e306100dd8a06aa8423b81d;p=thirdparty%2Fchrony.git Add asserts for timeout delays --- diff --git a/sched.c b/sched.c index a08baa1f..95452120 100644 --- a/sched.c +++ b/sched.c @@ -318,6 +318,7 @@ SCH_AddTimeoutByDelay(double delay, SCH_TimeoutHandler handler, SCH_ArbitraryArg struct timeval now, then; assert(initialised); + assert(delay >= 0.0); LCL_ReadRawTime(&now); UTI_AddDoubleToTimeval(&now, delay, &then); @@ -339,6 +340,7 @@ SCH_AddTimeoutInClass(double min_delay, double separation, double randomness, double new_min_delay; assert(initialised); + assert(min_delay >= 0.0); assert(class < SCH_NumberOfClasses); if (randomness > 0.0) {