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:
rfm 2010-06-10 05:04:55 +00:00
parent c5bd50b2db
commit 10f1e77d82
2 changed files with 11 additions and 1 deletions

View file

@ -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);