• 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: Problem mac os X version 10.6 when using sprinft
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem mac os X version 10.6 when using sprinft


  • Subject: Re: Problem mac os X version 10.6 when using sprinft
  • From: Greg Parker <email@hidden>
  • Date: Fri, 7 May 2010 12:34:32 -0700

On May 7, 2010, at 11:59 AM, paul morel wrote:
> Hi,I'm trying to use a c function:
> 	sprintf(sFormat, "%%d\t%%0.ß\t%%0.ß\t%%0.ß\t%%0.ß\n", n1, n1, n1, n1);
> When I compile my program for Mac OS X 10.5 and run the program everything is ok, whereas as soon as I use Mac OS X 10.6 the program crashes at this "sprintf" and there is a "SIGABRT"! And I have no clue why! Does anybody have an idea?

Works for me. There's probably a bug elsewhere in your code. Perhaps `sFormat` is too small, or you're in fact crashing in a different place.

% cat test.c
#include <stdio.h>
int main() {
    char sFormat[1000];
    int n1 = 42;
    sprintf(sFormat, "%%d\t%%0.ß\t%%0.ß\t%%0.ß\t%%0.ß\n", n1, n1, n1, n1);
    printf("sFormat: %s", sFormat);
    return 0;
}
% cc test.c
% ./a.out
sFormat: %d	%0.42f	%0.42f	%0.42f	%0.42f


--
Greg Parker     email@hidden     email@hidden     Runtime Wrangler


_______________________________________________

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

References: 
 >Problem mac os X version 10.6 when using sprinft (From: paul morel <email@hidden>)

  • Prev by Date: Re: Synthesized ivar for std::tr1::shared_ptr<MyClass>?
  • Next by Date: Re: Synthesized ivar for std::tr1::shared_ptr<MyClass>?
  • Previous by thread: Re: Problem mac os X version 10.6 when using sprinft
  • Next by thread: Problem mac os X version 10.6 when using sprinft
  • Index(es):
    • Date
    • Thread