use freopen(3) correctly

This commit is contained in:
Humm 2021-01-29 10:55:42 +01:00
parent efe6d37f68
commit 1e80be4840
2 changed files with 2 additions and 2 deletions

View File

@ -296,7 +296,7 @@ static void nmstermio_set_terminal(int s) {
static int state = 1;
if (!isatty(STDIN_FILENO)) {
stdin = freopen("/dev/tty", "r", stdin);
freopen("/dev/tty", "r", stdin);
}
if (s == 0) {

View File

@ -28,7 +28,7 @@ static int foregroundColor = COLOR_BLUE; // Foreground color settin
*/
void nmstermio_init_terminal(void) {
if (!isatty(STDIN_FILENO)) {
stdin = freopen("/dev/tty", "r", stdin);
freopen("/dev/tty", "r", stdin);
}
initscr();
cbreak();