mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-08-24 16:42:25 +08:00
2011-02-01 Ralf Corsepius <ralf.corsepius@rtems.org>
* libmisc/stringto/stringtounsignedlong.c: Reformat range check.
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user