summaryrefslogtreecommitdiff
path: root/time.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-12-18 09:46:21 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-12-18 09:46:21 +0000
commit117b7d5c47f31b02cf891c792f919afceaddd080 (patch)
treed927327cf133d6c690b582751a5e535fb48c0495 /time.c
parent652f744cba955435d0c69f17fa42c3c7b88bcbe9 (diff)
matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1065 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'time.c')
-rw-r--r--time.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/time.c b/time.c
index 0e2fa0f97b..2ef06eb6f7 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);