mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 16:30:41 +00:00
* Source/NSPropertyList.m (GSBinaryPLParser -objectAtIndex:):
Use long long for all integer types. Before we used signed types which resulted wrong values for negative integers. * Source/NSKeyedUnarchiver.m (-_decodeObject:): Handle the string "$null" as nil all the times. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33934 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
6b8dc7ef6c
commit
926f3ccb03
3 changed files with 19 additions and 20 deletions
|
@ -2998,28 +2998,18 @@ GSPropertyListMake(id obj, NSDictionary *loc, BOOL xml,
|
|||
unsigned i;
|
||||
unsigned char buffer[16];
|
||||
|
||||
if (len > sizeof(unsigned long long))
|
||||
{
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"Stored number too long (%d bytes) in property list", len];
|
||||
}
|
||||
|
||||
[data getBytes: buffer range: NSMakeRange(counter, len)];
|
||||
for (i = 0; i < len; i++)
|
||||
{
|
||||
num = (num << 8) + buffer[i];
|
||||
}
|
||||
|
||||
if (next == 0x10)
|
||||
{
|
||||
result = [NSNumber numberWithUnsignedChar: (unsigned char)num];
|
||||
}
|
||||
else if (next == 0x11)
|
||||
{
|
||||
result = [NSNumber numberWithUnsignedShort: (unsigned short)num];
|
||||
}
|
||||
else if ((next == 0x12) || (next == 13))
|
||||
{
|
||||
result = [NSNumber numberWithUnsignedInt: (unsigned int)num];
|
||||
}
|
||||
else
|
||||
{
|
||||
result = [NSNumber numberWithUnsignedLongLong: num];
|
||||
}
|
||||
result = [NSNumber numberWithLongLong: (long long)num];
|
||||
}
|
||||
else if (next == 0x22)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue