summaryrefslogtreecommitdiffstats
path: root/tools/lib/h5tools.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2009-03-31 17:32:54 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2009-03-31 17:32:54 (GMT)
commita29e811343bce0275dc44671b767a2eebbf86593 (patch)
tree11eec69c03676e21a4cbecb7dda280ac76fd1e73 /tools/lib/h5tools.c
parent505b31ee08bfd3efc62df84e00602a9fd6c46a4f (diff)
downloadhdf5-a29e811343bce0275dc44671b767a2eebbf86593.zip
hdf5-a29e811343bce0275dc44671b767a2eebbf86593.tar.gz
hdf5-a29e811343bce0275dc44671b767a2eebbf86593.tar.bz2
[svn-r16634] Description:
Bring r16618:16633 back from trunk to revise_chunks branch. Tested on: FreeBSD/32 6.3 (duty) in debug mode FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode Linux/32 2.6 (jam) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x, w/C++ & FORTRAN, in production mode Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN, w/szip filter, in production mode Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN, in production mode Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode Mac OS X/32 10.5.6 (amazon) in debug mode Mac OS X/32 10.5.6 (amazon) w/C++ & FORTRAN, w/threadsafe, in production mode
Diffstat (limited to 'tools/lib/h5tools.c')
-rw-r--r--tools/lib/h5tools.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c
index a1d0696..4955f95 100644
--- a/tools/lib/h5tools.c
+++ b/tools/lib/h5tools.c
@@ -944,8 +944,12 @@ h5tools_dump_simple_subset(FILE *stream, const h5tool_format_t *info, hid_t dset
sm_nbytes = p_type_nbytes = H5Tget_size(p_type);
if (ctx.ndims > 0)
- for (i = ctx.ndims; i > 0; --i) {
- sm_size[i - 1] = MIN(total_size[i - 1], H5TOOLS_BUFSIZE / sm_nbytes);
+ for (i = ctx.ndims; i > 0; --i)
+ {
+ hsize_t size = H5TOOLS_BUFSIZE / sm_nbytes;
+ if ( size == 0) /* datum size > H5TOOLS_BUFSIZE */
+ size = 1;
+ sm_size[i - 1] = MIN(total_size[i - 1], size);
sm_nbytes *= sm_size[i - 1];
assert(sm_nbytes > 0);
}