diff options
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | src/cInput.cpp | 5 |
2 files changed, 5 insertions, 2 deletions
@@ -6,3 +6,5 @@ build/* doc/* version.h +tags +*.swp diff --git a/src/cInput.cpp b/src/cInput.cpp index 6384c91..32da417 100644 --- a/src/cInput.cpp +++ b/src/cInput.cpp @@ -23,8 +23,9 @@ cInput::~cInput() sInputEvent cInput::poll() { + const unsigned int buff_len = 5; sInputEvent ret; - unsigned char buff [6]; + unsigned char buff [buff_len]; //setup for select fd_set rfds; @@ -47,7 +48,7 @@ sInputEvent cInput::poll() } else if (buff[0] == '\x1B') //Escape sequence { - read (STDIN_FILENO, &buff, 5); + read (STDIN_FILENO, &buff, buff_len); if(buff[0] == '[') { if(buff[1] == 'M') //Mouse Event |