From 3a1857a875f3c249a53a3fd6d4e6057b831a968b Mon Sep 17 00:00:00 2001 From: jonas Date: Sun, 21 Apr 2019 17:40:53 +0200 Subject: cInput: removed static buffer length .gitignore: added missing files --- src/cInput.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/cInput.cpp') 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 -- cgit v1.2.3