mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 00:30:53 +00:00
OSX compatibility fix
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@35532 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
0fea583bc5
commit
b9bcf33a8d
2 changed files with 19 additions and 16 deletions
|
@ -724,32 +724,28 @@ typedef GSString *ivars;
|
|||
/* Check for trailing exponent */
|
||||
if ((_scanLocation < myLength()) && ((c == 'e') || (c == 'E')))
|
||||
{
|
||||
unsigned int expScanLocation = _scanLocation;
|
||||
int expval;
|
||||
|
||||
|
||||
_scanLocation++;
|
||||
if ([self _scanInt: &expval])
|
||||
{
|
||||
/* Check for exponent overflow */
|
||||
if (num)
|
||||
{
|
||||
if ((exponent > 0) && (expval > (LONG_MAX - exponent)))
|
||||
exponent = LONG_MAX;
|
||||
else if ((exponent < 0) && (expval < (LONG_MIN - exponent)))
|
||||
exponent = LONG_MIN;
|
||||
else
|
||||
exponent += expval;
|
||||
}
|
||||
/* Check for exponent overflow */
|
||||
if (num)
|
||||
{
|
||||
if ((exponent > 0) && (expval > (LONG_MAX - exponent)))
|
||||
exponent = LONG_MAX;
|
||||
else if ((exponent < 0) && (expval < (LONG_MIN - exponent)))
|
||||
exponent = LONG_MIN;
|
||||
else
|
||||
exponent += expval;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef _ACCEPT_BAD_EXPONENTS_
|
||||
/* Numbers like 1.23eFOO are accepted (as 1.23). */
|
||||
_scanLocation = expScanLocation;
|
||||
#else
|
||||
/* Numbers like 1.23eFOO are rejected. */
|
||||
_scanLocation = saveScanLocation;
|
||||
return NO;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
if (value)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue