Skip to content

Commit

Permalink
Correctly handle large negative usec value.
Browse files Browse the repository at this point in the history
  • Loading branch information
clayton-shopify committed Apr 3, 2017
1 parent e2e2eda commit dc4fba2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mrbgems/mruby-time/src/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit dc4fba2

Please sign in to comment.