aboutsummaryrefslogtreecommitdiff
path: root/include/06.keyboard
diff options
context:
space:
mode:
Diffstat (limited to 'include/06.keyboard')
-rw-r--r--include/06.keyboard/keyboard.c7
-rw-r--r--include/06.keyboard/keyboard17.c7
2 files changed, 10 insertions, 4 deletions
diff --git a/include/06.keyboard/keyboard.c b/include/06.keyboard/keyboard.c
index a95d399..ab31315 100644
--- a/include/06.keyboard/keyboard.c
+++ b/include/06.keyboard/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;
}
diff --git a/include/06.keyboard/keyboard17.c b/include/06.keyboard/keyboard17.c
index 359ba30..171088f 100644
--- a/include/06.keyboard/keyboard17.c
+++ b/include/06.keyboard/keyboard17.c
@@ -15,8 +15,11 @@
{
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;
}