diff options
| author | mattn <[email protected]> | 2013-03-01 17:42:35 +0900 |
|---|---|---|
| committer | mattn <[email protected]> | 2013-03-01 17:42:35 +0900 |
| commit | cb2de0907a08f985c740f711c274c175217fccb9 (patch) | |
| tree | f3ac38592b9ff6fa10e760fe6f1fcad8f47ee82c /mrbgems/mruby-struct/src | |
| parent | 8ebf9c38e40c39a7ff1a04b49c744371d1872597 (diff) | |
| download | mruby-cb2de0907a08f985c740f711c274c175217fccb9.tar.gz mruby-cb2de0907a08f985c740f711c274c175217fccb9.zip | |
Fix copy values
Diffstat (limited to 'mrbgems/mruby-struct/src')
| -rw-r--r-- | mrbgems/mruby-struct/src/struct.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/mrbgems/mruby-struct/src/struct.c b/mrbgems/mruby-struct/src/struct.c index 3ee76a17e..c306bc7d9 100644 --- a/mrbgems/mruby-struct/src/struct.c +++ b/mrbgems/mruby-struct/src/struct.c @@ -441,7 +441,8 @@ mrb_struct_initialize_withArg(mrb_state *mrb, int argc, mrb_value *argv, mrb_val st = (struct RStruct *) mrb_malloc(mrb, sizeof(struct RStruct)); DATA_PTR(self) = st; DATA_TYPE(self) = &mrb_struct_type; - st->values = mrb_ary_new_from_values(mrb, argc, argv); + st->values = mrb_ary_new_capa(mrb, n); + struct_copy(RARRAY_PTR(st->values), argv, argc); mrb_iv_set(mrb, self, mrb_intern(mrb, "__values__"), st->values); return self; |
