mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 00:11:26 +00:00
Updates to reduce global namespace pollution. Plenty more remaining.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@23795 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
9d71af9cbf
commit
eae859d1c7
85 changed files with 1090 additions and 1277 deletions
|
@ -122,14 +122,12 @@ UTF8Str(const unsigned char *bytes)
|
|||
inline static NSString*
|
||||
UTF8StrLen(const unsigned char *bytes, unsigned length)
|
||||
{
|
||||
unsigned char *buf = NSZoneMalloc(NSDefaultMallocZone(), length+1);
|
||||
NSString *str;
|
||||
|
||||
memcpy(buf, bytes, length);
|
||||
buf[length] = '\0';
|
||||
str = UTF8Str(buf);
|
||||
NSZoneFree(NSDefaultMallocZone(), buf);
|
||||
return str;
|
||||
str = [[NSString_class alloc] initWithBytes: bytes
|
||||
length: length
|
||||
encoding: NSUTF8StringEncoding];
|
||||
return AUTORELEASE(str);
|
||||
}
|
||||
|
||||
static BOOL cacheDone = NO;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue