From d04b71c168abf2655583c7817127e1f68efa328f Mon Sep 17 00:00:00 2001
From: iceman1001 <iceman@iuse.se>
Date: Wed, 13 Jan 2016 00:14:08 +0100
Subject: [PATCH] FIX: tcgetattr for Linux in Ukbhit(), should return -1 if
 fail.

---
 client/util.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/client/util.c b/client/util.c
index 5b461649..9d4c83ee 100644
--- a/client/util.c
+++ b/client/util.c
@@ -21,14 +21,14 @@ int ukbhit(void)
   int error;
   static struct termios Otty, Ntty;
 
-  if ( tcgetattr( 0, &Otty) == -1) return false;
+  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);
-- 
2.39.5