From 9a65bd2d766446e593b4c3ce8e3fd3a0e04074ca Mon Sep 17 00:00:00 2001 From: matz Date: Mon, 18 Dec 2000 09:46:21 +0000 Subject: matz git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@1065 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- time.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'time.c') diff --git a/time.c b/time.c index 0e2fa0f97..2ef06eb6f 100644 --- a/time.c +++ b/time.c @@ -659,6 +659,10 @@ time_plus(time1, time2) sec++; usec -= 1000000; } + if (usec < 0) { /* usec underflow */ + sec--; + usec += 1000000; + } time2 = rb_time_new(sec, usec); if (tobj->gmt) { GetTimeval(time2, tobj); -- cgit