Reopen stdin in binary mode instead of closing/opening
This commit is contained in:
Colin Leroy-Mira 2024-01-28 17:00:02 +01:00
parent 51b946bf25
commit 7594af553a
1 changed files with 1 additions and 3 deletions

View File

@ -30,9 +30,7 @@ char *argv[];
#endif
{
/* Fake stdin with the reference file */
fclose(stdin);
stdin = fopen(INFILE, "r");
if (stdin == NULL) {
if (freopen(INFILE, "rb", stdin) == NULL) {
return EXIT_FAILURE;
}