2011-02-01 Ralf Corsepius <ralf.corsepius@rtems.org>

* libmisc/stringto/stringtofloat.c: Reformat range check.
	Add check for result = -HUGE_VALF.
This commit is contained in:
Ralf Corsepius
2011-02-01 05:41:48 +00:00
parent 61bbacea0a
commit a38457a755
2 changed files with 4 additions and 3 deletions

View File

@@ -1,5 +1,7 @@
2011-02-01 Ralf Corsepius <ralf.corsepius@rtems.org>
* libmisc/stringto/stringtofloat.c: Reformat range check.
Add check for result = -HUGE_VALF.
* libmisc/stringto/stringtodouble.c: Reformat range check.
Add check for result = -HUGE_VAL.
* libmisc/stringto/stringtolonglong.c: Reformat range check.

View File

@@ -48,9 +48,8 @@ rtems_status_code rtems_string_to_float (
if ( end == s )
return RTEMS_NOT_DEFINED;
if ( (result == HUGE_VALF) && (errno == ERANGE))
return RTEMS_INVALID_NUMBER;
if ( (result == 0) && (errno == ERANGE))
if ( ( errno == ERANGE ) &&
(( result == 0 ) || ( result == HUGE_VALF ) || ( result == -HUGE_VALF )))
return RTEMS_INVALID_NUMBER;
*n = result;