mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 16:30:41 +00:00
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:
parent
eab903ecad
commit
1085dd0ed2
2 changed files with 8 additions and 3 deletions
|
@ -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)];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue