summaryrefslogtreecommitdiff
path: root/src/c/keyboard.c
diff options
context:
space:
mode:
authorAleksa Vučković <aleksav013@gmail.com>2022-02-01 20:59:02 +0100
committerAleksa Vučković <aleksav013@gmail.com>2022-02-01 20:59:12 +0100
commitfad24f13855643b9410cfcd1045067e842e26f82 (patch)
tree11386b804fa7b8ce5c1368dd02a368f590234657 /src/c/keyboard.c
parent147200155c716a4ee76aa1f0402b90012d0a2883 (diff)
Keyboard buffer overflow fix
Diffstat (limited to 'src/c/keyboard.c')
-rw-r--r--src/c/keyboard.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/c/keyboard.c b/src/c/keyboard.c
index a95d399..ab31315 100644
--- a/src/c/keyboard.c
+++ b/src/c/keyboard.c
@@ -150,8 +150,11 @@ void keyboard_handler()
{
c=shift_charcode[keycode];
}
- buffer[buffer_current][buffer_index++]=c;
- printf("%c",c);
+ if(buffer_index<BUFFER_SIZE)
+ {
+ buffer[buffer_current][buffer_index++]=c;
+ printf("%c",c);
+ }
}
break;
}