diff options
Diffstat (limited to 'src/range.c')
| -rw-r--r-- | src/range.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/range.c b/src/range.c index 1615f03b2..be611b2a3 100644 --- a/src/range.c +++ b/src/range.c @@ -458,8 +458,8 @@ mrb_range_beg_len(mrb_state *mrb, mrb_value range, mrb_int *begp, mrb_int *lenp, if (!mrb_range_p(range)) return MRB_RANGE_TYPE_MISMATCH; r = mrb_range_ptr(mrb, range); - beg = mrb_nil_p(RANGE_BEG(r)) ? 0 : mrb_int(mrb, RANGE_BEG(r)); - end = mrb_nil_p(RANGE_END(r)) ? -1 : mrb_int(mrb, RANGE_END(r)); + beg = mrb_nil_p(RANGE_BEG(r)) ? 0 : mrb_as_int(mrb, RANGE_BEG(r)); + end = mrb_nil_p(RANGE_END(r)) ? -1 : mrb_as_int(mrb, RANGE_END(r)); excl = mrb_nil_p(RANGE_END(r)) ? 0 : RANGE_EXCL(r); if (beg < 0) { |
