Correctly handle large negative usec value.

parent e2e2edae
......@@ -245,7 +245,7 @@ time_alloc(mrb_state *mrb, double sec, double usec, enum mrb_timezone timezone)
tm->usec -= sec2 * 1000000;
tm->sec += sec2;
}
if (tm->usec >= 1000000) {
else if (tm->usec >= 1000000) {
long sec2 = usec / 1000000;
tm->usec -= sec2 * 1000000;
tm->sec += sec2;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment