Duh!!! (Insert forehead slap here)

Thanks for the very quick response.

Martin

On 2010-12-02, at 11:47 PM, Stephen J. Butler wrote:

> Not at all familiar with this library but...
> 
> On Thu, Dec 2, 2010 at 10:36 PM, Martin Stanley
> <r...@thinkingventures.com> wrote:
>>        int digits3 = m_apm_significant_digits(mapm3);
>>        char  out3[digits3 + 2]; // add 1 for the sign and 1 for the decimal 
>> point
> 
> What about space for the '\0' terminator?
> 
>>        m_apm_to_string(out3, DECIMAL_PLACES, mapm3);
>> 
>>        NSString *str = [NSString stringWithFormat:@"%s", out3];
> 
> You'd be better here using +[NSString stringWithUTF8String:]. Or
> +[NSString stringWithCString:encoding:]. Or -[NSString
> initWithBytes:length:encoding:] and then you don't need the '\0' at
> the end.

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to