diff options
author | Patrick Lu <ptlu@hawkwind.ncsa.uiuc.edu> | 2000-05-16 16:26:04 (GMT) |
---|---|---|
committer | Patrick Lu <ptlu@hawkwind.ncsa.uiuc.edu> | 2000-05-16 16:26:04 (GMT) |
commit | 4bd2ae82f6b9f7a0f3a4af4bdd5abadfe94387ee (patch) | |
tree | fdada341980f1e48b410996308e6b17d052e5b66 | |
parent | 3bd8b7b023cb6ea3c88a88675000ddc0da2cf127 (diff) | |
download | hdf5-4bd2ae82f6b9f7a0f3a4af4bdd5abadfe94387ee.zip hdf5-4bd2ae82f6b9f7a0f3a4af4bdd5abadfe94387ee.tar.gz hdf5-4bd2ae82f6b9f7a0f3a4af4bdd5abadfe94387ee.tar.bz2 |
[svn-r2255] added an extra conditional to the the for loop in the h5dump_simple_mem
function. it was entering the loop even when the ndims and i were equal to 0
which shouldnt have happened(only in dangermouse). didnt know how else to fix
it
-rw-r--r-- | tools/h5tools.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tools/h5tools.c b/tools/h5tools.c index a71116b..828bd23 100644 --- a/tools/h5tools.c +++ b/tools/h5tools.c @@ -1499,11 +1499,13 @@ h5dump_simple_mem(FILE *stream, const h5dump_t *info, hid_t type, /* Assume entire data space to be printed */ for (i=0; i<(hsize_t)(ctx.ndims); i++) ctx.p_min_idx[i] = 0; H5Sget_simple_extent_dims(space, ctx.p_max_idx, NULL); - - - for (i=0, nelmts=1; i<(hsize_t)(ctx.ndims); i++) { - nelmts *= ctx.p_max_idx[i] - ctx.p_min_idx[i]; + /*added the extra condition because dangermouse would enter the loop even + when it wasnt supposed to. gave us bugs in the release version after the tools + lib merge*/ + for (i=0,nelmts=1; (ctx.ndims != 0) && (i<(hsize_t)(ctx.ndims)); i++) { + nelmts *= ctx.p_max_idx[i] - ctx.p_min_idx[i]; } + if (0==nelmts) return 0; /*nothing to print*/ ctx.size_last_dim = ctx.p_max_idx[ctx.ndims-1]; |