diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2011-05-12 17:23:43 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2011-05-12 17:23:43 (GMT) |
commit | a56750c9b597a737de208d9dba0133cafe0a0a68 (patch) | |
tree | c1c679fd82c811693d0452f2178600729c9551c0 /tools/lib/h5tools_str.c | |
parent | 83703a978470d7e25a1b3ea17b2b03a8615a60e9 (diff) | |
download | hdf5-a56750c9b597a737de208d9dba0133cafe0a0a68.zip hdf5-a56750c9b597a737de208d9dba0133cafe0a0a68.tar.gz hdf5-a56750c9b597a737de208d9dba0133cafe0a0a68.tar.bz2 |
[svn-r20802] Bring trunk revision 20798 to 1.8. Trunk changes passed overnight.
Tested: local linux
Diffstat (limited to 'tools/lib/h5tools_str.c')
-rw-r--r-- | tools/lib/h5tools_str.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c index 9b7e8f2..54e2584 100644 --- a/tools/lib/h5tools_str.c +++ b/tools/lib/h5tools_str.c @@ -390,8 +390,12 @@ h5tools_str_region_prefix(h5tools_str_t *str, const h5tool_format_t *info, p_prod[i - 1] = (max_idx[i]) * p_prod[i]; for (i = 0; i < (size_t) ndims; i++) { - ctx->pos[i] = curr_pos / p_prod[i]; - curr_pos -= p_prod[i] * ctx->pos[i]; + if(curr_pos > 0) { + ctx->pos[i] = curr_pos / p_prod[i]; + curr_pos -= p_prod[i] * ctx->pos[i]; + } + else + ctx->pos[i] = 0; ctx->pos[i] += (unsigned long) ptdata[ctx->sm_pos+i]; } |