[PATCH 03/16] [WineX11]: key_vector boundaries

Eric Pouech eric.pouech at wanadoo.fr
Sun Oct 22 14:48:07 CDT 2006


- as the min keycode is always greater or equal to 8, we don't
  need to scan XKeymapEvent.key_vector from 0 but from 8
- this removes a valgrind warning about accessins
  XKeymapEvent.key_vector[0] which is never set

A+
---

 dlls/winex11.drv/keyboard.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/dlls/winex11.drv/keyboard.c b/dlls/winex11.drv/keyboard.c
index 534e197..7768151 100644
--- a/dlls/winex11.drv/keyboard.c
+++ b/dlls/winex11.drv/keyboard.c
@@ -1283,7 +1283,10 @@ void X11DRV_KeymapNotify( HWND hwnd, XEv
     DWORD time = GetCurrentTime();
 
     alt = control = shift = 0;
-    for (i = 0; i < 32; i++)
+    /* the minimum keycode is always greater or equal to 8, so we can
+     * skip the first 8 values, hence start at 1
+     */
+    for (i = 1; i < 32; i++)
     {
         if (!event->xkeymap.key_vector[i]) continue;
         for (j = 0; j < 8; j++)



More information about the wine-patches mailing list