forked from Imagelibrary/rtems
2011-02-01 Ralf Corsepius <ralf.corsepius@rtems.org>
* libmisc/stringto/stringtodouble.c: Reformat range check. Add check for result = -HUGE_VAL.
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
2011-02-01 Ralf Corsepius <ralf.corsepius@rtems.org>
|
||||
|
||||
* libmisc/stringto/stringtodouble.c: Reformat range check.
|
||||
Add check for result = -HUGE_VAL.
|
||||
* libmisc/stringto/stringtolonglong.c: Reformat range check.
|
||||
c99 portability improvements. Add check for result==0.
|
||||
* libmisc/stringto/stringtounsignedlonglong.c: Reformat range check.
|
||||
|
||||
@@ -48,9 +48,8 @@ rtems_status_code rtems_string_to_double (
|
||||
if ( end == s )
|
||||
return RTEMS_NOT_DEFINED;
|
||||
|
||||
if ( (result == HUGE_VAL) && (errno == ERANGE))
|
||||
return RTEMS_INVALID_NUMBER;
|
||||
if ( (result == 0) && (errno == ERANGE))
|
||||
if ( ( errno == ERANGE ) &&
|
||||
(( result == 0 ) || ( result == HUGE_VAL ) || ( result == -HUGE_VAL )))
|
||||
return RTEMS_INVALID_NUMBER;
|
||||
|
||||
*n = result;
|
||||
|
||||
Reference in New Issue
Block a user