mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
mruby-time/time.c (time_value_from_time_t): should raise exception
When time_t does not fit in mrb_int; ref #5958
This commit is contained in:
@@ -316,6 +316,8 @@ time_value_from_time_t(mrb_state *mrb, time_t t)
|
||||
}
|
||||
#elif !defined(MRB_NO_FLOAT)
|
||||
return mrb_float_value(mrb, (mrb_float)t);
|
||||
#else
|
||||
mrb_raisef(mrb, E_ARGUMENT_ERROR, "Time too big");
|
||||
#endif
|
||||
}
|
||||
return mrb_int_value(mrb, (mrb_int)t);
|
||||
|
||||
Reference in New Issue
Block a user