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

* libmisc/stringto/stringtounsignedchar.c,
	libmisc/stringto/stringtounsignedint.c: Reformat range check.
This commit is contained in:
Ralf Corsepius
2011-02-01 05:55:32 +00:00
parent 5410c14a56
commit 200c945879
3 changed files with 8 additions and 10 deletions
+2
View File
@@ -1,5 +1,7 @@
2011-02-01 Ralf Corsepius <ralf.corsepius@rtems.org>
* libmisc/stringto/stringtounsignedchar.c,
libmisc/stringto/stringtounsignedint.c: Reformat range check.
* libmisc/Makefile.am: Add stringto/stringtolongdouble.c.
* libmisc/stringto/stringtolongdouble.c: New.
* libmisc/stringto/stringto.h: Rename header-guard.
@@ -49,11 +49,9 @@ rtems_status_code rtems_string_to_unsigned_char (
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;
#if (UCHAR_MAX < ULONG_MAX)
if ( result > UCHAR_MAX ) {
@@ -49,11 +49,9 @@ rtems_status_code rtems_string_to_unsigned_int (
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;
#if (UINT_MAX < ULONG_MAX)
if ( result > UINT_MAX ) {