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

* libmisc/stringto/stringtounsignedlong.c: Reformat range check.
This commit is contained in:
Ralf Corsepius committed 2011-02-01 05:36:03 +00:00
1 parent 80604fa73b
commit 37ecff5c4a
2 files changed
+4 -5

No files matched your search

+1
View File
@@ -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.
@@ -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;