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 2e9d927..acc59d2 100644
--- a/array.c
+++ b/array.c
@@ -502,7 +502,7 @@ rb_ary_shift(ary)
if (RARRAY(ary)->len == 0) return Qnil;
top = RARRAY(ary)->ptr[0];
if (RARRAY_LEN(ary) < ARY_DEFAULT_SIZE && !FL_TEST(ary, ELTS_SHARED)) {
- MEMMOVE(RARRAY_PTR(ary), RARRAY_PTR(ary)+1, VALUE, RARRAY_LEN(ary));
+ MEMMOVE(RARRAY_PTR(ary), RARRAY_PTR(ary)+1, VALUE, RARRAY_LEN(ary)-1);
}
else {
if (!FL_TEST(ary, ELTS_SHARED)) {