Replaced unsafe unages of fscanf with fscanf_s