mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 17:10:48 +00:00
Fix for initialization of strings from data in a generic non-unicode encod
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@9560 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
04635e37a5
commit
1ccb1ba60b
1 changed files with 5 additions and 2 deletions
|
@ -1076,8 +1076,10 @@ handle_printf_atsign (FILE *stream,
|
|||
unsigned count;
|
||||
const unsigned char *b;
|
||||
|
||||
if (len < 2)
|
||||
return [self initWithCStringNoCopy: 0 length: 0 freeWhenDone: NO];
|
||||
if (len < 1 || (len < 2 && encoding == NSUnicodeStringEncoding))
|
||||
{
|
||||
return [self initWithCStringNoCopy: 0 length: 0 freeWhenDone: NO];
|
||||
}
|
||||
|
||||
b = [data bytes];
|
||||
u = NSZoneMalloc(GSObjCZone(self), sizeof(unichar)*(len+1));
|
||||
|
@ -3171,6 +3173,7 @@ handle_printf_atsign (FILE *stream,
|
|||
unsigned count;
|
||||
|
||||
[aCoder decodeValueOfObjCType: @encode(unsigned) at: &count];
|
||||
|
||||
if (count > 0)
|
||||
{
|
||||
NSStringEncoding enc;
|
||||
|
|
Loading…
Reference in a new issue