Re: Cocoa-dev Digest, Vol 3, Issue 58
Re: Cocoa-dev Digest, Vol 3, Issue 58
- Subject: Re: Cocoa-dev Digest, Vol 3, Issue 58
- From: Heinrich Giesen <email@hidden>
- Date: Sat, 14 Jan 2006 17:22:22 +0100
hello,
On 14.01.2006, at 12:44, W. Thomas Leroux wrote:
char dna1 [100000] = {0};
int random;
int iterations = 120000;
you cannot write 120000 bytes into an array of size 100000
not even into an array of 120000. Remember the
string terminating Zero.
saver is:
#define MAX_ITERATIONS 123456
char dna1[MAX_ITERATIONS+1] = {0};
int iterations = MAX_ITERATIONS;
If this works (and it works) then make stylisting changes.
BTW: in Cocoa you could use an NSMutableData object which is
more flexible and save concerning buffer overflow.
--
Heinrich Giesen
email@hidden
_______________________________________________
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