summaryrefslogtreecommitdiff
path: root/array.c
diff options
context:
space:
mode:
Diffstat (limited to 'array.c')
-rw-r--r--array.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/array.c b/array.c
index 73e8a3c9ce..a33c43bdbf 100644
--- a/array.c
+++ b/array.c
@@ -1389,7 +1389,7 @@ ary_make_partial_step(VALUE ary, VALUE klass, long offset, long len, long step)
}
long ustep = (step < 0) ? -step : step;
- len = (len + ustep - 1) / ustep;
+ len = roomof(len, ustep);
long i;
long j = offset + ((step > 0) ? 0 : (orig_len - 1));