Return false in fscanf if the file is empty

This will fix #3352.