Re: Displaying a number with Quartz
Re: Displaying a number with Quartz
- Subject: Re: Displaying a number with Quartz
- From: Alexander Spohr <email@hidden>
- Date: Tue, 26 May 2009 17:12:20 +0200
Am 26.05.2009 um 17:00 schrieb Sean McBride:
Never ever use sprintf for anything.
If you use "%d" and know it will be an int? You know how many chars
you’ll have at max, no buffer-overflow possible. (You might argue
here, that at some time we will habe 128-bit ints, but hey you should
recode your app then anyway or just have a buffer large enough to
handle that right at the start)
And yes - you are right, use snprintf instead... int might become 256
bit.
See here for why:
<http://developer.apple.com/documentation/security/conceptual/
SecureCodingGuide/Articles/BufferOverflows.html#//apple_ref/doc/uid/
TP40002577-SW10>
On 5/26/09 3:26 PM, Alexander Spohr said:
sprintf
Am 25.05.2009 um 09:16 schrieb Pierre Berloquin:
Hi
I need to display an int with CGContextShowTextAtPoint
that only accepts char arrays.
How do I go about it ?
I can't find how to convert an int into a char* in objective-C !!
_______________________________________________
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