From 16a37e1eaf98f723b330870d174b96cf1a3baccd Mon Sep 17 00:00:00 2001 From: Robert Lunnon Date: Sat, 7 May 2005 12:18:24 +0000 Subject: [PATCH] Avoid passing NULL buffer elements and status pointers to XmbLookupString. --- dlls/x11drv/keyboard.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/dlls/x11drv/keyboard.c b/dlls/x11drv/keyboard.c index b84d3c4147b..d11a5d9c8a2 100644 --- a/dlls/x11drv/keyboard.c +++ b/dlls/x11drv/keyboard.c @@ -1061,11 +1061,13 @@ static const WORD nonchar_key_scan[256] = static WORD EVENT_event_to_vkey( XIC xic, XKeyEvent *e) { KeySym keysym = 0; + Status status; + char buf[24]; if (xic) - XmbLookupString(xic, e, NULL, 0, &keysym, NULL); + XmbLookupString(xic, e, buf, sizeof(buf), &keysym, &status); else - XLookupString(e, NULL, 0, &keysym, NULL); + XLookupString(e, buf, sizeof(buf), &keysym, NULL); if ((keysym >= 0xFFAE) && (keysym <= 0xFFB9) && (keysym != 0xFFAF) && (e->state & NumLockMask)) @@ -2280,6 +2282,7 @@ INT X11DRV_ToUnicodeEx(UINT virtKey, UINT scanCode, LPBYTE lpKeyState, char lpChar[10]; HWND focus; XIC xic; + Status status; if (scanCode & 0x8000) { @@ -2366,7 +2369,7 @@ INT X11DRV_ToUnicodeEx(UINT virtKey, UINT scanCode, LPBYTE lpKeyState, e.type, e.window, e.state, e.keycode); if (xic) - ret = XmbLookupString(xic, &e, lpChar, sizeof(lpChar), &keysym, NULL); + ret = XmbLookupString(xic, &e, lpChar, sizeof(lpChar), &keysym, &status); else ret = XLookupString(&e, lpChar, sizeof(lpChar), &keysym, NULL); wine_tsx11_unlock();