diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2020-08-29 21:29:10 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2020-10-12 18:20:07 +0900 |
| commit | d0b5d720ace3c0289dc37f3c6e9a05391e057273 (patch) | |
| tree | bb76ede47f1cb12df52a560bbabd03e9637bd4e8 | |
| parent | dd1ce5d53efa9a00cd9bdc7a7771bc6489da4469 (diff) | |
| download | mruby-d0b5d720ace3c0289dc37f3c6e9a05391e057273.tar.gz mruby-d0b5d720ace3c0289dc37f3c6e9a05391e057273.zip | |
Use `mrb_integer()` instead of `mrb_int()`.
`mrb_int()` includes implicit integer conversion, where `mrb_integer()`
does not. In this case, we know `obj` is an integer before hand.
| -rw-r--r-- | mrbgems/mruby-time/src/time.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mrbgems/mruby-time/src/time.c b/mrbgems/mruby-time/src/time.c index f0347f54f..6fde1b2d1 100644 --- a/mrbgems/mruby-time/src/time.c +++ b/mrbgems/mruby-time/src/time.c @@ -258,7 +258,7 @@ mrb_to_time_t(mrb_state *mrb, mrb_value obj, time_t *usec) default: case MRB_TT_INTEGER: { - mrb_int i = mrb_int(mrb, obj); + mrb_int i = mrb_integer(obj); 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)) { |
