mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 00:11:26 +00:00
Fix bug getting cstring from literal containing illegal characters.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@25227 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
7fce994a67
commit
d1f2ea541a
3 changed files with 11 additions and 0 deletions
|
@ -1,3 +1,8 @@
|
|||
2007-06-08 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/GSString.m Fix bug getting cString from literal string
|
||||
with illegal (non-ascii) characters.
|
||||
|
||||
2007-06-06 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/NSKeyValueCoding.m: Use UTF8 rather than ASCII
|
||||
|
|
|
@ -1864,6 +1864,7 @@ getCStringE_c(GSStr self, char *buffer, unsigned int maxLength,
|
|||
* from internal format to unicode and then to the specified
|
||||
* C string encoding.
|
||||
*/
|
||||
bytes = maxLength - sizeof(char);
|
||||
if (GSToUnicode(&u, &l, self->_contents.c, self->_count,
|
||||
internalEncoding, NSDefaultMallocZone(), 0) == NO)
|
||||
{
|
||||
|
|
|
@ -554,6 +554,11 @@ static id ValueForKey(NSObject *self, const char *key, unsigned size)
|
|||
char key[size+1];
|
||||
|
||||
GSOnceMLog(@"This method is deprecated, use -setValue:forKey:");
|
||||
if (anObject == nil)
|
||||
{
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"Attempt to set nil value for key '%@'", aKey];
|
||||
}
|
||||
[aKey getCString: key
|
||||
maxLength: size+1
|
||||
encoding: NSUTF8StringEncoding];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue