mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 16:30:41 +00:00
Improve binary property list creation.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@22257 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
eb37725f8a
commit
23d5a370a8
2 changed files with 14 additions and 2 deletions
|
@ -3270,7 +3270,7 @@ GSPropertyListMake(id obj, NSDictionary *loc, BOOL xml,
|
|||
{
|
||||
unsigned char code;
|
||||
|
||||
if (count <= 256)
|
||||
if (count < 256)
|
||||
{
|
||||
unsigned char c;
|
||||
|
||||
|
@ -3279,7 +3279,7 @@ GSPropertyListMake(id obj, NSDictionary *loc, BOOL xml,
|
|||
c = count;
|
||||
[dest appendBytes: &c length: 1];
|
||||
}
|
||||
else
|
||||
else if (count < 256 * 256)
|
||||
{
|
||||
unsigned short c;
|
||||
|
||||
|
@ -3289,6 +3289,13 @@ GSPropertyListMake(id obj, NSDictionary *loc, BOOL xml,
|
|||
NSSwapHostShortToBig(c);
|
||||
[dest appendBytes: &c length: 2];
|
||||
}
|
||||
else
|
||||
{
|
||||
code = 0x13;
|
||||
[dest appendBytes: &code length: 1];
|
||||
count = NSSwapHostIntToBig(count);
|
||||
[dest appendBytes: &count length: 4];
|
||||
}
|
||||
}
|
||||
|
||||
- (void) storeData: (NSData*) data
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue