Posts: 1,466
Threads: 7
Joined: Jun 2009
Reputation:
0
index is too small? did you do something like this? new index[1]; ? Make it bigger. (I'm guessing)
Posts: 212
Threads: 15
Joined: Jan 2008
Reputation:
0
tmp and tmp2 need to be bigger, I don't know what the limit for strtok is but it has a lowest one
Posts: 410
Threads: 9
Joined: Jan 2006
Reputation:
0
strtok returns a string of a fixed size. You get the error because strtok is returning a string bigger than 30 cells long, it's like trying to put an airplane in your garage designed to hold only your car. It just won't work, there's not enough space.
If you increase the size of tmp and tmp2 to a size bigger than or the same size as the array returned in strtok (look at the function code, try search for the array named 'result') then that will get rid of your error. I cannot tell you the exact number because it changes from script to script... some numbers if you can't find the right size are 128 and 256.
I would recommend ditching strtok and using sscanf. It's faster, won't cry about array sizes and is a lot more flexible.
Posts: 19
Threads: 2
Joined: Oct 2010
Reputation:
0
Fixed itby making the size of the tmp, tmp2, to 480.
Thanks.