diff options
author | Pedro Vicente Nunes <pvn@hdfgroup.org> | 2004-03-29 16:53:52 (GMT) |
---|---|---|
committer | Pedro Vicente Nunes <pvn@hdfgroup.org> | 2004-03-29 16:53:52 (GMT) |
commit | 8eb5f818bab32fcf61cf805b880c5cc4dd1e98bc (patch) | |
tree | 536ff3ef907acc78aee6fcdc31b13d371ed84cc9 /tools/h5diff | |
parent | fb37f831bcc1ccd378980d25f06b174e99daf314 (diff) | |
download | hdf5-8eb5f818bab32fcf61cf805b880c5cc4dd1e98bc.zip hdf5-8eb5f818bab32fcf61cf805b880c5cc4dd1e98bc.tar.gz hdf5-8eb5f818bab32fcf61cf805b880c5cc4dd1e98bc.tar.bz2 |
[svn-r8286] Purpose:
bug fix continuation
Description:
the atof return value on a hexadecimal input is different
on some systems; before checking for the atof return value
do a character check for the first 2 characters of the string input
Solution:
Platforms tested:
linux
solaris
Misc. update:
Diffstat (limited to 'tools/h5diff')
-rw-r--r-- | tools/h5diff/h5diff_main.c | 9 | ||||
-rwxr-xr-x | tools/h5diff/testh5diff.sh | 4 |
2 files changed, 10 insertions, 3 deletions
diff --git a/tools/h5diff/h5diff_main.c b/tools/h5diff/h5diff_main.c index 17c9d22..8dbce22 100644 --- a/tools/h5diff/h5diff_main.c +++ b/tools/h5diff/h5diff_main.c @@ -252,7 +252,7 @@ int check_n_input( const char *str ) /*------------------------------------------------------------------------- * Function: check_f_input * - * Purpose: check for valid input + * Purpose: check for a valid floating point input * * Return: 1 for ok, -1 for fail * @@ -270,6 +270,13 @@ static int check_f_input( const char *str ) { double x; + + /* + the atof return value on a hexadecimal input is different + on some systems; we do a character check for this + */ + if (strlen(str)>2 && str[0]=='0' && str[1]=='x') + return -1; x=atof(str); if (x==0) diff --git a/tools/h5diff/testh5diff.sh b/tools/h5diff/testh5diff.sh index 43753e5..23cbfaa 100755 --- a/tools/h5diff/testh5diff.sh +++ b/tools/h5diff/testh5diff.sh @@ -202,7 +202,7 @@ TOOLTEST h5diff_604.txt file1.h5 file2.h5 -d 0 g1/dset3 g1/dset4 TOOLTEST h5diff_605.txt file1.h5 file2.h5 -d u g1/dset3 g1/dset4 # 6.6: hexadecimal -#TOOLTEST h5diff_606.txt file1.h5 file2.h5 -d 0x1 g1/dset3 g1/dset4 +TOOLTEST h5diff_606.txt file1.h5 file2.h5 -d 0x1 g1/dset3 g1/dset4 # 6.7: string TOOLTEST h5diff_607.txt file1.h5 file2.h5 -d "1" g1/dset3 g1/dset4 @@ -235,7 +235,7 @@ TOOLTEST h5diff_613.txt file1.h5 file2.h5 -p 0 g1/dset3 g1/dset4 TOOLTEST h5diff_614.txt file1.h5 file2.h5 -p u g1/dset3 g1/dset4 # 6.15: hexadecimal -#TOOLTEST h5diff_615.txt file1.h5 file2.h5 -p 0x1 g1/dset3 g1/dset4 +TOOLTEST h5diff_615.txt file1.h5 file2.h5 -p 0x1 g1/dset3 g1/dset4 # 6.16: string TOOLTEST h5diff_616.txt file1.h5 file2.h5 -p "0.21" g1/dset3 g1/dset4 |