diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2017-05-16 19:54:53 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2017-05-16 19:54:53 (GMT) |
commit | 858155c19b1d2cacb91e37da0155a537ddd205e6 (patch) | |
tree | 9997886b79e9ea6cd986c8a56cc8fa38cd9fa8ba /tools/lib | |
parent | 3e1a06e6494c9dd9a6f4b39e702949159e803283 (diff) | |
parent | 71637634ac96b6167b384ebb461ce3b9ea66b4f8 (diff) | |
download | hdf5-858155c19b1d2cacb91e37da0155a537ddd205e6.zip hdf5-858155c19b1d2cacb91e37da0155a537ddd205e6.tar.gz hdf5-858155c19b1d2cacb91e37da0155a537ddd205e6.tar.bz2 |
Merge pull request #519 in HDFFV/hdf5 from ~BYRN/hdf5_adb:develop to develop
* commit '71637634ac96b6167b384ebb461ce3b9ea66b4f8':
HDFFV-9995 Clarify help text
HDFFV-10128 Fixed string length with no null fixed
Diffstat (limited to 'tools/lib')
-rw-r--r-- | tools/lib/h5diff_array.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c index 0a9d18a..499d5eb 100644 --- a/tools/lib/h5diff_array.c +++ b/tools/lib/h5diff_array.c @@ -665,6 +665,7 @@ static hsize_t diff_datum(void *_mem1, size_t size1; size_t size2; size_t sizex; + size_t size_mtype = H5Tget_size(m_type); H5T_str_t pad = H5Tget_strpad(m_type); /* if variable length string */ @@ -682,17 +683,21 @@ static hsize_t diff_datum(void *_mem1, /* Get pointer to first string */ s1 = (char*) mem1; size1 = HDstrlen(s1); + if (size1 > size_mtype) + size1 = size_mtype; /* Get pointer to second string */ s2 = (char*) mem2; size2 = HDstrlen(s2); + if (size2 > size_mtype) + size2 = size_mtype; } else { /* Get pointer to first string */ s1 = (char *)mem1; - size1 = H5Tget_size(m_type); + size1 = size_mtype; /* Get pointer to second string */ s2 = (char *)mem2; - size2 = H5Tget_size(m_type); + size2 = size_mtype; } /* |