there needs to be room for ".mag"......but really since it looks like the size of temp is the same each
iteration of the loop, you should just declare it statically, instead of allocating and freeing each time each time.

p.s. don't forget to close out somewhere

11-14-2006

vart

It is not enough
"Lightcurves\\modelB.00.mag"
takes more than 20 characters allocated in the modelfile array, so each strcpy(modelfile[i/5], temp); overwrites some additional bytes...