summaryrefslogtreecommitdiffstats
path: root/tools/lib/h5diff_util.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/lib/h5diff_util.c')
-rw-r--r--tools/lib/h5diff_util.c31
1 files changed, 17 insertions, 14 deletions
diff --git a/tools/lib/h5diff_util.c b/tools/lib/h5diff_util.c
index 6d340d9..dfdc8b3 100644
--- a/tools/lib/h5diff_util.c
+++ b/tools/lib/h5diff_util.c
@@ -35,24 +35,27 @@ print_dimensions (int rank, hsize_t *dims)
{
int i;
- if ( rank > 0 )
- {
-
- parallel_print("[" );
- for ( i = 0; i < rank-1; i++)
- {
- parallel_print(HSIZE_T_FORMAT, dims[i]);
- parallel_print("x");
- }
-
- parallel_print(HSIZE_T_FORMAT, dims[rank-1]);
- parallel_print("]" );
- }
- else
+ if ( rank <= 0 )
{
parallel_print("H5S_SCALAR" );
}
+ else
+ {
+ if (!dims)
+ parallel_print("dimension is NULL");
+ else
+ {
+ parallel_print("[");
+ for ( i = 0; i < rank-1; i++)
+ {
+ parallel_print(HSIZE_T_FORMAT, dims[i]);
+ parallel_print("x");
+ }
+ parallel_print(HSIZE_T_FORMAT, dims[rank-1]);
+ parallel_print("]" );
+ }
+ }
}