[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug in NSString:-dataUsingEncoding:allowLossyConversion:
From: |
Stephen Brandon |
Subject: |
bug in NSString:-dataUsingEncoding:allowLossyConversion: |
Date: |
Tue, 12 Feb 2002 17:42:19 +0000 |
In NSString:-dataUsingEncoding:allowLossyConversion:, the variable "count" is
used as a buffer byte counter for most formats (NSASCIIStringEncoding,
NSISOLatin1StringEncoding etc), and the malloced buffer is converted to a
NSData object using "count" as the data count.
For NSUTF8StringEncoding however, "count" is not used as the counter -- "j"
is. But "count" is still used in line 2296 as the byte count sent to the
NSData object. This is always zero.
NSString:2296 was:
return [NSDataClass dataWithBytesNoCopy: buff
length: count];
and should be:
return [NSDataClass dataWithBytesNoCopy: buff
length: j];
Cheers,
Stephen Brandon
- bug in NSString:-dataUsingEncoding:allowLossyConversion:,
Stephen Brandon <=