From a8d9f5cfbc57ee86a79e36bc1b9913f0bddd1a12 Mon Sep 17 00:00:00 2001 From: Pedro Vicente Nunes Date: Thu, 30 Jun 2005 11:53:11 -0500 Subject: [svn-r11003] Purpose: bug fix Description: when diffing a string type string , a cycle is made using the hdf5 get_size function, which returns the type size some strings might have a NULL terminator character before the type size position this was noticed on a HDF-EOS file on the HDFEOSVersion attribute which was defined as a type with a 32 size, but contained a string with 12 characters, making h5diff to compare the extra garbage characters Solution: detect the NULL terminator character and end the diff at that position Platforms tested: linux Misc. update: --- tools/lib/h5diff_array.c | 59 +++++++++++++++++++++++++++++++----------------- 1 file changed, 38 insertions(+), 21 deletions(-) diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c index 1ed4ab2..3632cdb 100644 --- a/tools/lib/h5diff_array.c +++ b/tools/lib/h5diff_array.c @@ -321,27 +321,44 @@ hsize_t diff_datum(void *_mem1, *------------------------------------------------------------------------- */ case H5T_STRING: - - if(H5Tis_variable_str(m_type)) - type_size = HDstrlen((char*)mem1); - else - type_size = H5Tget_size(m_type); - - for (u=0; u