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:
CaS 2003-07-08 08:39:45 +00:00
parent 86a8fd6a23
commit 0383992b80
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> 2003-07-08 03:44 Alexander Malmberg <alexander@malmberg.org>
* Source/Additions/Unicode.m (GSToUnicode, GSFromUnicode): In iconv * Source/Additions/Unicode.m (GSToUnicode, GSFromUnicode): In iconv

View file

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