Corrected two bugs in binary pl decoding.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@18551 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2004-02-07 18:15:34 +00:00
parent eab903ecad
commit 1085dd0ed2
2 changed files with 8 additions and 3 deletions

View file

@ -1,3 +1,8 @@
2004-02-04 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSPropertyList.m: (GSBinaryPLParser -objectAtIndex:)
Corrected two small errors for the new binary parser.
2004-02-07 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSKeyedUnarchiver.m: Changes to fix memory leaks.

View file

@ -2449,14 +2449,14 @@ OAppend(id obj, NSDictionary *loc, unsigned lev, unsigned step,
[data getBytes: buffer range: NSMakeRange(counter, len)];
for (i = 0; i < len; i++)
{
num = num*256 + buffer[counter + i];
num = num*256 + buffer[i];
}
result = [NSNumber numberWithInt: num];
}
else if (next == 0x22)
{
// float number
float in;
NSSwappedFloat in;
[data getBytes: &in range: NSMakeRange(counter, sizeof(float))];
result = [NSNumber numberWithFloat: NSSwapBigFloatToHost(in)];
@ -2464,7 +2464,7 @@ OAppend(id obj, NSDictionary *loc, unsigned lev, unsigned step,
else if (next == 0x23)
{
// double number
double in;
NSSwappedDouble in;
[data getBytes: &in range: NSMakeRange(counter, sizeof(double))];
result = [NSNumber numberWithFloat: NSSwapBigDoubleToHost(in)];