=== modified file 'termkey.c' --- termkey.c 2008-02-10 20:24:25 +0000 +++ termkey.c 2008-02-10 20:22:33 +0000 @@ -188,15 +188,14 @@ static inline void eatbytes(termkey_t *tk, size_t count) { - if(count >= tk->buffcount) { + tk->buffstart += count; + tk->buffcount -= count; + + if(tk->buffcount <= 0) { tk->buffstart = 0; tk->buffcount = 0; - return; } - tk->buffstart += count; - tk->buffcount -= count; - size_t halfsize = tk->buffsize / 2; if(tk->buffstart > halfsize) {