Quote:
Originally Posted by
shamrock
Checking the return value of calloc would be a good place to start...
For production code, definitely, add the error handling code. For unimportant, personal stuff, I'm sure we all cut corners from time to time.
In this case, unless I'm mistaken, the first calloc of the second loop iteration never returns. When it calls malloc, malloc aborts after detecting corruption caused by fseek writing to memory freed by fclose.
Regards,
Alister