aboutsummaryrefslogtreecommitdiff
path: root/termkey.c
diff options
context:
space:
mode:
Diffstat (limited to 'termkey.c')
-rw-r--r--termkey.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/termkey.c b/termkey.c
index 5f5a9a9..163e168 100644
--- a/termkey.c
+++ b/termkey.c
@@ -733,6 +733,11 @@ static TermKeyResult peekkey(TermKey *tk, TermKeyKey *key, int force, size_t *nb
{
int again = 0;
+ if(!tk->is_started) {
+ errno = EINVAL;
+ return TERMKEY_RES_ERROR;
+ }
+
#ifdef DEBUG
fprintf(stderr, "getkey(force=%d): buffer ", force);
print_buffer(tk);