summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore2
-rw-r--r--src/cInput.cpp5
2 files changed, 5 insertions, 2 deletions
diff --git a/.gitignore b/.gitignore
index e9cc8ed..4903daf 100644
--- a/.gitignore
+++ b/.gitignore
@@ -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