From cbb83c4fcee19d89d7b4927dcad734af02d24f24 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Sun, 26 Feb 2012 20:19:58 +0100 Subject: [PATCH] kbdfs: properly handle zero length write to kbdin --- sys/src/cmd/aux/kbdfs/kbdfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/src/cmd/aux/kbdfs/kbdfs.c b/sys/src/cmd/aux/kbdfs/kbdfs.c index 58c4e8bba..90e22484b 100644 --- a/sys/src/cmd/aux/kbdfs/kbdfs.c +++ b/sys/src/cmd/aux/kbdfs/kbdfs.c @@ -1114,9 +1114,9 @@ fswrite(Req *r) case Qkbdin: p = r->ifcall.data; n = r->ifcall.count; - if(n <= 0) - n = 0; r->ofcall.count = n; + if(n == 0) + break; if(p[n-1] != 0){ /* * old format as used by bitsy keyboard: