List only *.csv files

This

(fname == file_list)

will never do what you expect it to do. You are comparing if the addresses (pointers) of the two strings are the same.

If you want to compare whether the strings are the same you need to use the strcmp() function, like you were in previous code to compare the file extension.