[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bug in NSString:-dataUsingEncoding:allowLossyConversion:

From: Richard Frith-Macdonald
Subject: Re: bug in NSString:-dataUsingEncoding:allowLossyConversion:
Date: Tue, 12 Feb 2002 17:53:02 +0000

On Tuesday, February 12, 2002, at 05:42 PM, Stephen Brandon wrote:

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];

Thanks ... fixed that in CVS.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]