diff options
Diffstat (limited to 'src/RecoverVar.c')
-rw-r--r-- | src/RecoverVar.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/RecoverVar.c b/src/RecoverVar.c index 593dda4..90072a2 100644 --- a/src/RecoverVar.c +++ b/src/RecoverVar.c @@ -384,7 +384,7 @@ static int GetCommonAttributes (const cGH *GH, hid_t datatype, dataspace; hsize_t rank_stored, *dims_stored; int grouptype_stored, numtimelevels_stored; - char *groupname, *msg; + char *groupname, *msg, *oldmsg; char groupname_stored[128]; @@ -513,16 +513,24 @@ static int GetCommonAttributes (const cGH *GH, fullname, (int) dims_stored[0]); for (i = 1; i < group_static_data.dim; i++) { + oldmsg = msg; Util_asprintf (&msg, "%s, %d", msg, (int) dims_stored[i]); + free (oldmsg); } dims = unchunked ? group_dynamic_data.gsh : group_dynamic_data.lsh; + oldmsg = msg; Util_asprintf (&msg, "%s), expected (%d", msg, dims[group_static_data.dim - 1]); + free (oldmsg); for (i = 1; i < group_static_data.dim; i++) { + oldmsg = msg; Util_asprintf (&msg, "%s, %d", msg, dims[group_static_data.dim-i-1]); + free (oldmsg); } + oldmsg = msg; Util_asprintf (&msg, "%s)", msg); + free (oldmsg); CCTK_VWarn (2, __LINE__, __FILE__, CCTK_THORNSTRING, msg); free (msg); } |