summaryrefslogtreecommitdiffhomepage
path: root/mrbgems
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2014-05-03 23:35:24 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2014-05-03 23:35:24 +0900
commit1519e441a0676b8aaea8dbc123ad09cd9e6e449e (patch)
tree52b7d512b93adff52d7aa9b5d45d1d34e45dbd46 /mrbgems
parent206c96e4a7ae37af6244ae37bc95751a2b36e73d (diff)
downloadmruby-1519e441a0676b8aaea8dbc123ad09cd9e6e449e.tar.gz
mruby-1519e441a0676b8aaea8dbc123ad09cd9e6e449e.zip
use proper length for mrb_get_values_at()
separate mrb_range_beg_len() into two: the one truncates range into the sequence size, and the one does not. #values_at uses the latter.
Diffstat (limited to 'mrbgems')
-rw-r--r--mrbgems/mruby-array-ext/src/array.c2
-rw-r--r--mrbgems/mruby-struct/src/struct.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/mrbgems/mruby-array-ext/src/array.c b/mrbgems/mruby-array-ext/src/array.c
index 12d0ec743..ae9d8296e 100644
--- a/mrbgems/mruby-array-ext/src/array.c
+++ b/mrbgems/mruby-array-ext/src/array.c
@@ -131,7 +131,7 @@ mrb_ary_values_at(mrb_state *mrb, mrb_value self)
mrb_get_args(mrb, "*", &argv, &argc);
- return mrb_get_values_at(mrb, self, MRB_INT_MAX, argc, argv, mrb_ary_ref);
+ return mrb_get_values_at(mrb, self, RARRAY_LEN(self), argc, argv, mrb_ary_ref);
}
void
diff --git a/mrbgems/mruby-struct/src/struct.c b/mrbgems/mruby-struct/src/struct.c
index 40ad88aca..3c2a89b77 100644
--- a/mrbgems/mruby-struct/src/struct.c
+++ b/mrbgems/mruby-struct/src/struct.c
@@ -843,7 +843,7 @@ mrb_struct_values_at(mrb_state *mrb, mrb_value self)
mrb_get_args(mrb, "*", &argv, &argc);
- return mrb_get_values_at(mrb, self, MRB_INT_MAX, argc, argv, struct_values_at_getter);
+ return mrb_get_values_at(mrb, self, RSTRUCT_LEN(self), argc, argv, struct_values_at_getter);
}
/*