• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Using MAPM with Cocoa/ObjectiveC
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using MAPM with Cocoa/ObjectiveC


  • Subject: Re: Using MAPM with Cocoa/ObjectiveC
  • From: "Stephen J. Butler" <email@hidden>
  • Date: Thu, 2 Dec 2010 22:47:09 -0600

Not at all familiar with this library but...

On Thu, Dec 2, 2010 at 10:36 PM, Martin Stanley
<email@hidden> 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 (email@hidden)

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:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Using MAPM with Cocoa/ObjectiveC
      • From: Martin Stanley <email@hidden>
References: 
 >Using MAPM with Cocoa/ObjectiveC (From: Martin Stanley <email@hidden>)

  • Prev by Date: Re: IB xib and toolbar not building properly
  • Next by Date: Disable toolbar items
  • Previous by thread: Using MAPM with Cocoa/ObjectiveC
  • Next by thread: Re: Using MAPM with Cocoa/ObjectiveC
  • Index(es):
    • Date
    • Thread