Fix copy values

This commit is contained in:
mattn
2013-03-01 17:42:35 +09:00
parent 8ebf9c38e4
commit cb2de0907a
+2 -1
View File
@@ -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;