aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/RecoverVar.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/RecoverVar.c b/src/RecoverVar.c
index 980d653..4a5b56f 100644
--- a/src/RecoverVar.c
+++ b/src/RecoverVar.c
@@ -442,12 +442,8 @@ static int GetCommonAttributes (cGH *GH,
HDF5_ERROR (dataspace = H5Dget_space (dataset));
HDF5_ERROR (rank_stored = H5Sget_simple_extent_ndims (dataspace));
/* scalars are stored as rank 0 in HDF5 but have rank 1 in Cactus */
- if (rank_stored == 0)
- {
- rank_stored = 1;
- dims_stored = NULL;
- }
- else
+ dims_stored = NULL;
+ if (rank_stored > 0)
{
dims_stored = (hsize_t *) malloc (rank_stored * sizeof (hsize_t));
HDF5_ERROR (H5Sget_simple_extent_dims (dataspace, dims_stored, NULL));