mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
compatibility tweak
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@30644 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
e3a7134ee5
commit
00e6f2a9c1
2 changed files with 11 additions and 1 deletions
|
@ -1,4 +1,10 @@
|
|||
2010-06-10 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/NSString.m: Raise exception if a null pointer is passed to
|
||||
+stringWithUTF8String: for compatibility with OSX.
|
||||
|
||||
2010-06-09 David Wetzel <dave@turbocat.de>
|
||||
|
||||
* Source/Additions/GSXML.m:
|
||||
check for NULL string
|
||||
stringWithUTF8String: raises on OSX if you feed it with a NULL string.
|
||||
|
|
|
@ -767,12 +767,16 @@ handle_printf_atsign (FILE *stream,
|
|||
}
|
||||
|
||||
/**
|
||||
* Create a string based on the given UTF-8 string, null-terminated.
|
||||
* Create a string based on the given UTF-8 string, null-terminated.<br />
|
||||
* Raises NSInvalidArgumentException if given NULL pointer.
|
||||
*/
|
||||
+ (id) stringWithUTF8String: (const char *)bytes
|
||||
{
|
||||
NSString *obj;
|
||||
|
||||
if (NULL == bytes)
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"[NSString+stringWithUTF8String:]: NULL cString"];
|
||||
obj = [self allocWithZone: NSDefaultMallocZone()];
|
||||
obj = [obj initWithUTF8String: bytes];
|
||||
return AUTORELEASE(obj);
|
||||
|
|
Loading…
Reference in a new issue