mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-20 12:16:40 +00:00
Fix a bunch of NSString bugs.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@16636 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
ab69a55361
commit
6c7f43d46d
3 changed files with 88 additions and 74 deletions
|
@ -32,6 +32,7 @@
|
|||
#include <Foundation/NSArray.h>
|
||||
#include <Foundation/NSBundle.h>
|
||||
#include <Foundation/NSDictionary.h>
|
||||
#include <Foundation/NSException.h>
|
||||
#include <Foundation/NSString.h>
|
||||
#include <Foundation/NSLock.h>
|
||||
#include <Foundation/NSPathUtilities.h>
|
||||
|
@ -1349,12 +1350,21 @@ tables:
|
|||
ptr = NSZoneRealloc(zone, ptr, bytes);
|
||||
}
|
||||
}
|
||||
else if (ptr == buf)
|
||||
{
|
||||
ptr = NULL;
|
||||
result = NO;
|
||||
}
|
||||
*dst = ptr;
|
||||
}
|
||||
else if (ptr != buf && dst != 0 && ptr != *dst)
|
||||
{
|
||||
NSZoneFree(zone, ptr);
|
||||
}
|
||||
|
||||
if (dst)
|
||||
NSCAssert(*dst != buf, @"attempted to pass out pointer to internal buffer");
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -1949,12 +1959,21 @@ tables:
|
|||
ptr = NSZoneRealloc(zone, ptr, bytes);
|
||||
}
|
||||
}
|
||||
else if (ptr == buf)
|
||||
{
|
||||
ptr = NULL;
|
||||
result = NO;
|
||||
}
|
||||
*dst = ptr;
|
||||
}
|
||||
else if (ptr != buf && dst != 0 && ptr != *dst)
|
||||
{
|
||||
NSZoneFree(zone, ptr);
|
||||
}
|
||||
|
||||
if (dst)
|
||||
NSCAssert(*dst != buf, @"attempted to pass out pointer to internal buffer");
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue