Re: stringWithCString:length deprecation
Re: stringWithCString:length deprecation
- Subject: Re: stringWithCString:length deprecation
- From: Graham Cox <email@hidden>
- Date: Wed, 7 Oct 2009 23:07:18 +1100
On 07/10/2009, at 11:00 PM, Torsten Curdt wrote:
But that doesn't look like a real replacement. Shouldn't there be a
stringWithCString:length:encoding
What am I missing?
Pointers? Comments? Suggestions?
My guess is that in deprecating this they also took the opportunity to
remove an API that really doesn't make sense. A string in C is defined
to be terminated by a NULL byte, so any array of characters that
contains NULL bytes that doesn't terminate them isn't a C string.
Perhaps also it eliminates a possible source of buffer overruns that
are known to be a security issue.
If you have an array of characters that contain NULL bytes you'll have
to scan them into a string in a different way.
--Graham
_______________________________________________
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