summaryrefslogtreecommitdiffstats
path: root/cpukit/libmisc
diff options
context:
space:
mode:
authorRalf Corsepius <ralf.corsepius@rtems.org>2011-02-01 05:41:07 +0000
committerRalf Corsepius <ralf.corsepius@rtems.org>2011-02-01 05:41:07 +0000
commit61bbacea0a14c09c8e03491db7211cb2e57fe2b3 (patch)
treeba68b708d9d0a24b5f944523900306281744e8b5 /cpukit/libmisc
parent2011-02-01 Ralf Corsepius <ralf.corsepius@rtems.org> (diff)
downloadrtems-61bbacea0a14c09c8e03491db7211cb2e57fe2b3.tar.bz2
2011-02-01 Ralf Corsepius <ralf.corsepius@rtems.org>
* libmisc/stringto/stringtodouble.c: Reformat range check. Add check for result = -HUGE_VAL.
Diffstat (limited to 'cpukit/libmisc')
-rw-r--r--cpukit/libmisc/stringto/stringtodouble.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/cpukit/libmisc/stringto/stringtodouble.c b/cpukit/libmisc/stringto/stringtodouble.c
index bee9384891..ec50a1332b 100644
--- a/cpukit/libmisc/stringto/stringtodouble.c
+++ b/cpukit/libmisc/stringto/stringtodouble.c
@@ -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;