You should just scatter around a bunch of printf statements and figure out for yourself where it's crashing. Without us having your data, and without something motivating me to play guessing games with your code, to be honest, it's not worth the effort.

You don't give any indicator as to where you are when it crashes. Is it when you're running through your data? When you open a file? Close a file? Are any new files getting created? Honestly, you'd be better off just making a simple program to first be sure you know how to read through multiple command line arguments.

If you know you're doing that right, try just renaming all of those files. If you know you can do that right, now start worrying about their contents.


Quzah.