Minor fix

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@17173 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-Macdonald 2003-07-08 08:39:45 +00:00
parent dd482c40f6
commit a13e212bbf
2 changed files with 11 additions and 5 deletions

View file

@ -1,3 +1,8 @@
2003-07-08 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSString.m: Avoid using atof() in parsing plists ... we
don't want libc localised handling of numbers.
2003-07-08 03:44 Alexander Malmberg <alexander@malmberg.org>
* Source/Additions/Unicode.m (GSToUnicode, GSFromUnicode): In iconv

View file

@ -80,6 +80,8 @@
#include "GSPrivate.h"
extern BOOL GSScanDouble(unichar*, unsigned, double*);
@class GSString;
@class GSMutableString;
@class GSPlaceholderString;
@ -2425,8 +2427,6 @@ handle_printf_atsign (FILE *stream,
return [self intValue] != 0 ? YES : NO;
}
extern BOOL GSScanDouble(unichar*, unsigned, double*);
/**
* Returns the strings content as a double. Skips leading whitespace.<br />
* Conversion is not localised (ie uses '.' as the decimal separator).<br />
@ -4858,11 +4858,12 @@ static id parsePlItem(pldata* pld)
}
else if (type == 'R')
{
char buf[len+1];
unichar buf[len];
double d = 0.0;
for (i = 0; i < len; i++) buf[i] = (char)ptr[i];
buf[len] = '\0';
result = [[NSNumber alloc] initWithDouble: atof(buf)];
GSScanDouble(buf, len, &d);
result = [[NSNumber alloc] initWithDouble: d];
}
else
{