summaryrefslogtreecommitdiff
path: root/time.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-12-22 03:22:25 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-12-22 03:22:25 +0000
commit0e47c138c9bba4396fc7d956b05e5725000012f1 (patch)
tree54fac5b90c2ce6664e7017d954add4d06e388a09 /time.c
parent31c53aaa7dc3da8bc9ba6b3007c183dcbeeafe11 (diff)
matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1068 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 2ef06eb..e45e2e8 100644
--- a/time.c
+++ b/time.c
@@ -696,6 +696,10 @@ time_minus(time1, time2)
sec = tobj->tv.tv_sec - sec;
}
+ if (usec >= 1000000) { /* usec overflow */
+ sec++;
+ usec -= 1000000;
+ }
if (usec < 0) { /* usec underflow */
sec--;
usec += 1000000;