diff options
author | Bill Wendling <wendling@ncsa.uiuc.edu> | 2000-11-21 17:39:38 (GMT) |
---|---|---|
committer | Bill Wendling <wendling@ncsa.uiuc.edu> | 2000-11-21 17:39:38 (GMT) |
commit | 82f9e0338ad3ba2f0cb9116305b1304f4ba0f12c (patch) | |
tree | 873bac1653e7d31b00cc6320fa9a5bb428a854a8 | |
parent | a7e6dfe5bc705841ca1faf2d8e5c5d63f8c760f5 (diff) | |
download | hdf5-82f9e0338ad3ba2f0cb9116305b1304f4ba0f12c.zip hdf5-82f9e0338ad3ba2f0cb9116305b1304f4ba0f12c.tar.gz hdf5-82f9e0338ad3ba2f0cb9116305b1304f4ba0f12c.tar.bz2 |
[svn-r2984] Purpose:
Bug fix
Description:
The code for determining what a string should print out if it was
declared as H5T_STR_NULLTERM (C strings), H5T_STR_SPACEPAD
(Fortran strings), or H5T_STR_NULLPAD (print null characters to
the end of the line) was mucked. A user had a problem with it and
suggested a change, but the change didn't seem to work properly.
Also, if the string was H5T_STR_SPACEPAD, it could have stopped
when encountering a NULL even if it hadn't gotten to the end of
the string.
Solution:
Reworked the code to make it more understandable what's happening
and to add in support for H5T_STR_SPACEPAD which may have been
missing before.
Platforms tested:
Linux
-rw-r--r-- | tools/h5tools.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/h5tools.c b/tools/h5tools.c index 5a7b7d2..6f7b421 100644 --- a/tools/h5tools.c +++ b/tools/h5tools.c @@ -764,8 +764,8 @@ h5dump_sprint(h5dump_str_t *str/*in,out*/, const h5dump_t *info, quote = '\0'; pad = H5Tget_strpad(type); - for (i=0; - i < size && ((pad == H5T_STR_NULLPAD) ? 1 : (cp_vp[i] != '\0')); + for (i = 0; + i < size && (cp_vp[i] != '\0' || pad != H5T_STR_NULLTERM); i++) { int j = 1; |