mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
Use setmode instead of fdopen (#1520)
This commit is contained in:
@@ -490,7 +490,8 @@ void obj_ReadFile(char const *fileName, unsigned int fileID) {
|
||||
file = fopen(fileName, "rb");
|
||||
} else {
|
||||
fileName = "<stdin>";
|
||||
file = fdopen(STDIN_FILENO, "rb"); // `stdin` is in text mode by default
|
||||
(void)setmode(STDIN_FILENO, O_BINARY);
|
||||
file = stdin;
|
||||
}
|
||||
if (!file)
|
||||
err("Failed to open file \"%s\"", fileName);
|
||||
|
||||
Reference in New Issue
Block a user