diff --git a/CHANGES b/CHANGES index a3c403c741..46d5009ce7 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,7 @@ + + 472. [bug] Off-by-one error caused isc_time_add() to sometimes + produce invalid time values. + 471. [bug] nsupdate didn't compile on HP/UX 10.20 470. [feature] $GENERATE is now supported. See also diff --git a/lib/isc/unix/time.c b/lib/isc/unix/time.c index f6dc61e0bb..add0e94cf4 100644 --- a/lib/isc/unix/time.c +++ b/lib/isc/unix/time.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: time.c,v 1.28 2000/08/01 01:31:30 tale Exp $ */ +/* $Id: time.c,v 1.29 2000/09/18 18:43:03 gson Exp $ */ #include @@ -257,7 +257,7 @@ isc_time_add(isc_time_t *t, isc_interval_t *i, isc_time_t *result) { result->seconds = t->seconds + i->seconds; result->nanoseconds = t->nanoseconds + i->nanoseconds; - if (result->nanoseconds > NS_PER_S) { + if (result->nanoseconds >= NS_PER_S) { result->seconds++; result->nanoseconds -= NS_PER_S; }