Change out-of-range condition of `time_t` conversion.
@@ -256,8 +256,8 @@ mrb_to_time_t(mrb_state *mrb, mrb_value obj, time_t *usec)
{
mrb_int i = mrb_int(mrb, obj);
- if ((MRB_INT_MAX > MRB_TIME_MAX && i > 0 && i > (mrb_int)MRB_TIME_MAX) ||
- (!MRB_TIME_T_UINT && MRB_TIME_MIN > MRB_INT_MIN && MRB_TIME_MIN > i)) {
+ if ((MRB_INT_MAX > MRB_TIME_MAX && i > 0 && (time_t)i > MRB_TIME_MAX) ||
+ (0 > MRB_TIME_MIN && MRB_TIME_MIN > MRB_INT_MIN && MRB_TIME_MIN > i)) {
goto out_of_range;
}
