On Dec 8, 9:51pm, Jun T. wrote: } } Breaking out of the for-loop leaves the pointer t at the first Meta } in file_name, and the value of newsz becomes too small. } } How about the following? Yes, that would be better. I didn't notice that t was being used to compute a length.