diff options
author | jonas <himself@jonasgunz.de> | 2019-04-21 17:40:53 +0200 |
---|---|---|
committer | jonas <himself@jonasgunz.de> | 2019-04-21 17:40:53 +0200 |
commit | 3a1857a875f3c249a53a3fd6d4e6057b831a968b (patch) | |
tree | 5ac8eb9761cfe271926bbf59c52a929513c9af88 | |
parent | b2c1c2835ef77458c0a12f4e3be15f8e40f22997 (diff) | |
download | termgl-3a1857a875f3c249a53a3fd6d4e6057b831a968b.tar.gz |
cInput: removed static buffer length
.gitignore: added missing files
-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 |