X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/ab7bb4947515be233282a404fe2e84549aca9579..52cf34c1cc842412c10acadf83f7750a75e064bc:/client/util.c diff --git a/client/util.c b/client/util.c index de6443cf..9d4c83ee 100644 --- a/client/util.c +++ b/client/util.c @@ -21,14 +21,14 @@ int ukbhit(void) int error; static struct termios Otty, Ntty; - tcgetattr( 0, &Otty); + if ( tcgetattr( 0, &Otty) == -1) return -1; Ntty = Otty; - Ntty.c_iflag = 0; /* input mode */ - Ntty.c_oflag = 0; /* output mode */ - Ntty.c_lflag &= ~ICANON; /* raw mode */ - Ntty.c_cc[VMIN] = CMIN; /* minimum time to wait */ - Ntty.c_cc[VTIME] = CTIME; /* minimum characters to wait for */ + Ntty.c_iflag = 0; /* input mode */ + Ntty.c_oflag = 0; /* output mode */ + Ntty.c_lflag &= ~ICANON; /* raw mode */ + Ntty.c_cc[VMIN] = CMIN; /* minimum time to wait */ + Ntty.c_cc[VTIME] = CTIME; /* minimum characters to wait for */ if (0 == (error = tcsetattr(0, TCSANOW, &Ntty))) { error += ioctl(0, FIONREAD, &cnt);