mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-25 17:51:01 +00:00
Bugfix for encoding.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@3238 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
422963b224
commit
4f352e2786
1 changed files with 22 additions and 17 deletions
|
@ -1468,9 +1468,12 @@ failure:
|
|||
{
|
||||
[aCoder encodeValueOfObjCType: @encode(unsigned long)
|
||||
at: &length];
|
||||
[aCoder encodeArrayOfObjCType: @encode(unsigned char)
|
||||
count: length
|
||||
at: bytes];
|
||||
if (length)
|
||||
{
|
||||
[aCoder encodeArrayOfObjCType: @encode(unsigned char)
|
||||
count: length
|
||||
at: bytes];
|
||||
}
|
||||
}
|
||||
|
||||
/* Basic methods */
|
||||
|
@ -2214,23 +2217,25 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos)
|
|||
|
||||
- (id) initWithCoder: (NSCoder*)aCoder
|
||||
{
|
||||
unsigned l;
|
||||
void* b;
|
||||
unsigned l;
|
||||
void *b;
|
||||
|
||||
[aCoder decodeValueOfObjCType: @encode(unsigned long) at: &l];
|
||||
if (l) {
|
||||
[self initWithCapacity: l];
|
||||
if (bytes == 0) {
|
||||
NSLog(@"[NSMutableDataMalloc -initWithCoder:] unable to allocate %lu bytes", l);
|
||||
[self release];
|
||||
return nil;
|
||||
[aCoder decodeValueOfObjCType: @encode(unsigned long) at: &l];
|
||||
if (l)
|
||||
{
|
||||
[self initWithCapacity: l];
|
||||
if (bytes == 0)
|
||||
{
|
||||
NSLog(@"[NSMutableDataMalloc -initWithCoder:] unable to allocate %lu bytes", l);
|
||||
[self release];
|
||||
return nil;
|
||||
}
|
||||
[aCoder decodeArrayOfObjCType: @encode(unsigned char)
|
||||
count: l
|
||||
at: bytes];
|
||||
length = l;
|
||||
[aCoder decodeArrayOfObjCType: @encode(unsigned char)
|
||||
count: l
|
||||
at: bytes];
|
||||
length = l;
|
||||
}
|
||||
return self;
|
||||
return self;
|
||||
}
|
||||
|
||||
- (id) initWithLength: (unsigned)size
|
||||
|
|
Loading…
Reference in a new issue