summaryrefslogtreecommitdiffstats
path: root/tools/lib/h5tools.c
diff options
context:
space:
mode:
authorPedro Vicente Nunes <pvn@hdfgroup.org>2004-07-08 21:49:40 (GMT)
committerPedro Vicente Nunes <pvn@hdfgroup.org>2004-07-08 21:49:40 (GMT)
commitd5c705a642a1ed06fa8dcaa25b61aa75687799d2 (patch)
treeb8d6df906bbc40a0327d47f1da76d293da4aac59 /tools/lib/h5tools.c
parent1e800a55ca0c0096c1c8a545387d947eb9f9dd58 (diff)
downloadhdf5-d5c705a642a1ed06fa8dcaa25b61aa75687799d2.zip
hdf5-d5c705a642a1ed06fa8dcaa25b61aa75687799d2.tar.gz
hdf5-d5c705a642a1ed06fa8dcaa25b61aa75687799d2.tar.bz2
[svn-r8840] Purpose:
bug fix Description: when printing array indices , the calculation of the current column was not done correctly Solution: Platforms tested: linux AIX solaris Misc. update:
Diffstat (limited to 'tools/lib/h5tools.c')
-rw-r--r--tools/lib/h5tools.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c
index dbc8879..d25e9bb 100644
--- a/tools/lib/h5tools.c
+++ b/tools/lib/h5tools.c
@@ -408,7 +408,7 @@ h5tools_ncols(const char *s)
* Robb Matzke, 1999-09-29
* If a new prefix is printed then the current element number is set back
* to zero.
- * pvn, 2004-06-30
+ * pvn, 2004-07-08
* Added support for printing array indices:
* the indentation is printed before the prefix (printed one indentation
* level before)
@@ -472,9 +472,14 @@ h5tools_simple_prefix(FILE *stream, const h5dump_t *info,
for (i = 0; i < indentlevel; i++){
/*we already made the indent for the array indices case */
- if (!info->pindex)
- fputs(h5tools_str_fmt(&prefix, 0, info->line_indent), stream);
+ if (!info->pindex) {
+ fputs(h5tools_str_fmt(&prefix, 0, info->line_indent), stream);
templength += h5tools_str_len(&prefix);
+ }
+ else {
+ /*we cannot count the prefix for the array indices case */
+ templength += h5tools_str_len(&str);
+ }
}
ctx->cur_column = ctx->prev_prefix_len = templength;