Re: Problem mac os X version 10.6 when using sprinft
Re: Problem mac os X version 10.6 when using sprinft
- Subject: Re: Problem mac os X version 10.6 when using sprinft
- From: Alastair Houghton <email@hidden>
- Date: Mon, 10 May 2010 17:57:37 +0100
On 10 May 2010, at 16:54, paul morel wrote:
> Hi everybody,
> thanks a lot for your help.
> Actually you were right it size a problem of size. I increased the size and it works.
See, that worries me.
> The size was 20 because I thought that '\t' or other thing like that were considered directly as the 'final value', i.e. a space for example. And the value of n1 is 3.
> But what is weird is that it seems that with Mac OS X 10.5 there is no problem, whereas when I use Mac OS 10.6 the problem occurs.
> Anyway i understand now,
Well, do you? Increasing the size is only the right fix if you really understand what the size should be and why. Using snprintf() doesn't always save you because it might truncate the result, which may or may not cause other problems (though at least you won't have a buffer overflow).
I'd use NSString if I were you---it's safer.
Kind regards,
Alastair.
--
http://alastairs-place.net
_______________________________________________
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