summaryrefslogtreecommitdiffstats
path: root/tools/h5diff/h5diff_main.c
diff options
context:
space:
mode:
authorPedro Vicente Nunes <pvn@hdfgroup.org>2004-03-29 16:53:52 (GMT)
committerPedro Vicente Nunes <pvn@hdfgroup.org>2004-03-29 16:53:52 (GMT)
commit8eb5f818bab32fcf61cf805b880c5cc4dd1e98bc (patch)
tree536ff3ef907acc78aee6fcdc31b13d371ed84cc9 /tools/h5diff/h5diff_main.c
parentfb37f831bcc1ccd378980d25f06b174e99daf314 (diff)
downloadhdf5-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/h5diff_main.c')
-rw-r--r--tools/h5diff/h5diff_main.c9
1 files changed, 8 insertions, 1 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)