diff options
author | Matthieu Herrb <matthieu.herrb@laas.fr> | 2006-05-27 23:15:05 +0000 |
---|---|---|
committer | Matthieu Herrb <matthieu.herrb@laas.fr> | 2006-05-27 23:15:05 +0000 |
commit | c38aab293a06f43c04f14223f94f822d91d73396 (patch) | |
tree | 1b14670058266ecde24474bf3b788a47d49f7bd7 /hw | |
parent | 2102fdd0a58e18aeaa842b2ec73b6071970fafb7 (diff) |
check buffersize before reading next char, fixes the "mouse stuck at left"
bug (bugzilla #3113) for BSD systems using wscons. (Dale Rahn).
Diffstat (limited to 'hw')
-rw-r--r-- | hw/xfree86/os-support/bsd/bsd_mouse.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/xfree86/os-support/bsd/bsd_mouse.c b/hw/xfree86/os-support/bsd/bsd_mouse.c index 9c8e6699e..f54c7d7a5 100644 --- a/hw/xfree86/os-support/bsd/bsd_mouse.c +++ b/hw/xfree86/os-support/bsd/bsd_mouse.c @@ -401,7 +401,7 @@ wsconsReadInput(InputInfoPtr pInfo) XisbBlockDuration(pMse->buffer, -1); pBuf = (unsigned char *)eventList; n = 0; - while ((c = XisbRead(pMse->buffer)) >= 0 && n < sizeof(eventList)) { + while (n < sizeof(eventList) && (c = XisbRead(pMse->buffer)) >= 0) { pBuf[n++] = (unsigned char)c; } |