Re: EXC_BAD_ACCESS in NSData
Re: EXC_BAD_ACCESS in NSData
- Subject: Re: EXC_BAD_ACCESS in NSData
- From: Graham Cox <email@hidden>
- Date: Tue, 27 May 2014 09:20:13 +1000
On 27 May 2014, at 12:54 am, Roland King <email@hidden> wrote:
> datasize = *((unsigned int*)bytes);
>
> is a bit closer to what you might want but is endian-unaware.
That's just as wrong - you are using the first few bytes of the data as the length, which it certainly isn't (except for possibly a very few special cases that just so happen to have the length as the first field of the data).
--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