Re: malloc during selectAll -> crash
Re: malloc during selectAll -> crash
- Subject: Re: malloc during selectAll -> crash
- From: Nick Zitzmann <email@hidden>
- Date: Thu, 11 May 2006 08:27:44 -0600
On May 11, 2006, at 8:16 AM, Lorenzo wrote:
unsigned int i, totItems = [selectedRows count];
if(totItems == 0) return items ;
unsigned int *buf = malloc(totItems);
Try changing that last line to:
unsigned int *buf = malloc(totItems * sizeof(unsigned int))
malloc() takes an argument that specifies the number of bytes you
want, but each unsigned int is 4 bytes long.
Nick Zitzmann
<http://www.chronosnet.com/>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden