diff options
author | Ralf Corsepius <ralf.corsepius@rtems.org> | 2011-02-01 05:41:48 +0000 |
---|---|---|
committer | Ralf Corsepius <ralf.corsepius@rtems.org> | 2011-02-01 05:41:48 +0000 |
commit | a38457a7550da774ea962f7c854bc9cfd9b40831 (patch) | |
tree | b74e8e623485ce824faa6e2ac7e02cff8b526b23 /cpukit | |
parent | 2011-02-01 Ralf Corsepius <ralf.corsepius@rtems.org> (diff) | |
download | rtems-a38457a7550da774ea962f7c854bc9cfd9b40831.tar.bz2 |
2011-02-01 Ralf Corsepius <ralf.corsepius@rtems.org>
* libmisc/stringto/stringtofloat.c: Reformat range check.
Add check for result = -HUGE_VALF.
Diffstat (limited to 'cpukit')
-rw-r--r-- | cpukit/ChangeLog | 2 | ||||
-rw-r--r-- | cpukit/libmisc/stringto/stringtofloat.c | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog index b6c68e19af..8aec3a32f5 100644 --- a/cpukit/ChangeLog +++ b/cpukit/ChangeLog @@ -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. diff --git a/cpukit/libmisc/stringto/stringtofloat.c b/cpukit/libmisc/stringto/stringtofloat.c index 5ccd48321b..05ebe33566 100644 --- a/cpukit/libmisc/stringto/stringtofloat.c +++ b/cpukit/libmisc/stringto/stringtofloat.c @@ -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; |