diff --git a/main/gbx/gbx_c_array.c b/main/gbx/gbx_c_array.c index 3386b4dad..a4fd96bcf 100644 --- a/main/gbx/gbx_c_array.c +++ b/main/gbx/gbx_c_array.c @@ -1932,12 +1932,13 @@ static bool _convert(CARRAY *src, CLASS *class, VALUE *conv) END_ERROR } - dim = get_dim(src); - if (dim > 1) + if (src->n_dim) { + dim = get_dim(src); ALLOC(&array->dim, dim * sizeof(int)); for (i = 0; i < dim; i++) array->dim[i] = src->dim[i]; + array->n_dim = src->n_dim; } conv->_object.object = array;