summaryrefslogtreecommitdiffstats
path: root/cpukit
diff options
context:
space:
mode:
authorRalf Corsepius <ralf.corsepius@rtems.org>2011-02-01 05:36:03 +0000
committerRalf Corsepius <ralf.corsepius@rtems.org>2011-02-01 05:36:03 +0000
commit37ecff5c4aa83f2ccc1c62a163d220ae7c8eaac1 (patch)
tree9480248b7822145b5b36ab98ed5af072537e4b45 /cpukit
parent2011-02-01 Ralf Corsepius <ralf.corsepius@rtems.org> (diff)
downloadrtems-37ecff5c4aa83f2ccc1c62a163d220ae7c8eaac1.tar.bz2
2011-02-01 Ralf Corsepius <ralf.corsepius@rtems.org>
* libmisc/stringto/stringtounsignedlong.c: Reformat range check.
Diffstat (limited to 'cpukit')
-rw-r--r--cpukit/ChangeLog1
-rw-r--r--cpukit/libmisc/stringto/stringtounsignedlong.c8
2 files changed, 4 insertions, 5 deletions
diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog
index 8c0a4a292f..75134d258e 100644
--- a/cpukit/ChangeLog
+++ b/cpukit/ChangeLog
@@ -1,5 +1,6 @@
2011-02-01 Ralf Corsepius <ralf.corsepius@rtems.org>
+ * libmisc/stringto/stringtounsignedlong.c: Reformat range check.
* libmisc/stringto/stringtolong.c: Reformat range check.
Add check for result==0.
diff --git a/cpukit/libmisc/stringto/stringtounsignedlong.c b/cpukit/libmisc/stringto/stringtounsignedlong.c
index e26e85f0dc..11c374c486 100644
--- a/cpukit/libmisc/stringto/stringtounsignedlong.c
+++ b/cpukit/libmisc/stringto/stringtounsignedlong.c
@@ -49,11 +49,9 @@ rtems_status_code rtems_string_to_unsigned_long (
if ( end == s )
return RTEMS_NOT_DEFINED;
- if ( (result == ULONG_MAX) && (errno == ERANGE) )
- return RTEMS_INVALID_NUMBER;
-
- if ( (result == 0) && (errno == ERANGE) )
- return RTEMS_INVALID_NUMBER;
+ if ( ( errno == ERANGE ) &&
+ (( result == 0 ) || ( result == ULONG_MAX )))
+ return RTEMS_INVALID_NUMBER;
*n = result;