提交 4db1f47c 编写于 作者: D Dmitry Torokhov

Input: vsxxxaa - fix code dropping bytes from queue

I believe the intent of the code was to drop oldest bytes from the queue,
not the latest if we drop one byte and both latest and some oldest of we
are dropping more than one.
Acked-by: NJan-Benedict Glaw <jbglaw@lug-owl.de>
Signed-off-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
上级 60183a6e
...@@ -128,7 +128,7 @@ static void vsxxxaa_drop_bytes(struct vsxxxaa *mouse, int num) ...@@ -128,7 +128,7 @@ static void vsxxxaa_drop_bytes(struct vsxxxaa *mouse, int num)
if (num >= mouse->count) { if (num >= mouse->count) {
mouse->count = 0; mouse->count = 0;
} else { } else {
memmove(mouse->buf, mouse->buf + num - 1, BUFLEN - num); memmove(mouse->buf, mouse->buf + num, BUFLEN - num);
mouse->count -= num; mouse->count -= num;
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册