diff options
author | Paul LeoNerd Evans <leonerd@leonerd.org.uk> | 2012-03-08 21:31:16 +0000 |
---|---|---|
committer | Paul LeoNerd Evans <leonerd@leonerd.org.uk> | 2012-03-08 21:31:16 +0000 |
commit | 8237f3a1bc79687e37a6c6bf9ec66fde2eefe29d (patch) | |
tree | 3fa07611e567589b1152945e5e528549eee814f6 /termkey.c | |
parent | cb00476f09d5ab7e342f562e6c516f23c98aac88 (diff) | |
download | termo-8237f3a1bc79687e37a6c6bf9ec66fde2eefe29d.tar.gz termo-8237f3a1bc79687e37a6c6bf9ec66fde2eefe29d.tar.xz termo-8237f3a1bc79687e37a6c6bf9ec66fde2eefe29d.zip |
Have getkey/waitkey return RES_ERROR/EINVAL if stopped
Diffstat (limited to 'termkey.c')
-rw-r--r-- | termkey.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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); |