summaryrefslogtreecommitdiffstats
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
commitf0a1ba42c0789c0ed8ce4c6d75dd41a9969cc1ef (patch)
tree54fac5b90c2ce6664e7017d954add4d06e388a09 /time.c
parent3ed65cc170b2af485f59a8bc519f2569765906ca (diff)
downloadruby-f0a1ba42c0789c0ed8ce4c6d75dd41a9969cc1ef.tar.gz
ruby-f0a1ba42c0789c0ed8ce4c6d75dd41a9969cc1ef.tar.xz
ruby-f0a1ba42c0789c0ed8ce4c6d75dd41a9969cc1ef.zip
matz
git-svn-id: http://svn.ruby-lang.org/repos/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 2ef06eb6f..e45e2e854 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;