Other things to check:
1) How is '.speed' defined -- can it accept values over 100?
2) How is past[] defined -- subscripts 1..10 or 0..9 or ???
3) What is i when the statement is executed?
4) If the file is a total mess, with 65535 characters before a comma, then 'str' can grow to be over 65535 characters -- and 'err' can't contain a number that large.
5) If the file is a total mess, what happens if you get to the end-of-file without finding a single comma?
What compiler are you using? Do you have a decent debugger?
|