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

* libmisc/stringto/stringtoint.c: Reformat range check.
	Add check for result==0.
This commit is contained in:
Ralf Corsepius
2011-02-01 05:43:21 +00:00
parent a38457a755
commit fe7c9a1f83
2 changed files with 5 additions and 5 deletions
+2
View File
@@ -1,5 +1,7 @@
2011-02-01 Ralf Corsepius <ralf.corsepius@rtems.org>
* libmisc/stringto/stringtoint.c: Reformat range check.
Add check for result==0.
* libmisc/stringto/stringtofloat.c: Reformat range check.
Add check for result = -HUGE_VALF.
* libmisc/stringto/stringtodouble.c: Reformat range check.
+3 -5
View File
@@ -49,11 +49,9 @@ rtems_status_code rtems_string_to_int (
if ( end == s )
return RTEMS_NOT_DEFINED;
if ( (result == LONG_MAX) && (errno == ERANGE) )
return RTEMS_INVALID_NUMBER;
if ( (result == LONG_MIN) && (errno == ERANGE) )
return RTEMS_INVALID_NUMBER;
if ( ( errno == ERANGE ) &&
(( result == 0 ) || ( result == LONG_MAX ) || ( result == LONG_MIN )))
return RTEMS_INVALID_NUMBER;
#if (INT_MAX < LONG_MAX)
if ( result > INT_MAX ) {