mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 00:30:53 +00:00
NSPropertyList: use strtod to handle inf and nan
Apple's implementation seems to understand these things. We should too.
This commit is contained in:
parent
a76677623a
commit
69b202274a
1 changed files with 4 additions and 4 deletions
|
@ -345,7 +345,7 @@ foundIgnorableWhitespace: (NSString *)string
|
||||||
}
|
}
|
||||||
else if ([elementName isEqualToString: @"real"])
|
else if ([elementName isEqualToString: @"real"])
|
||||||
{
|
{
|
||||||
ASSIGN(plist, [NSNumber numberWithDouble: [value doubleValue]]);
|
ASSIGN(plist, [NSNumber numberWithDouble: strtod([value cString], 0)]);
|
||||||
}
|
}
|
||||||
else if ([elementName isEqualToString: @"true"])
|
else if ([elementName isEqualToString: @"true"])
|
||||||
{
|
{
|
||||||
|
@ -1170,11 +1170,11 @@ static id parsePlItem(pldata* pld)
|
||||||
else if (type == 'R')
|
else if (type == 'R')
|
||||||
{
|
{
|
||||||
unichar buf[len];
|
unichar buf[len];
|
||||||
double d = 0.0;
|
|
||||||
|
|
||||||
for (i = 0; i < len; i++) buf[i] = ptr[i];
|
for (i = 0; i < len; i++) buf[i] = ptr[i];
|
||||||
GSScanDouble(buf, len, &d);
|
buf[len] = '\0';
|
||||||
result = [[NSNumber alloc] initWithDouble: d];
|
result = [[NSNumber alloc]
|
||||||
|
initWithDouble: strtod(buf, 0)]];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue