Austin English : winex11: Make sure GetKeyNameText gets the correct length to return.
Alexandre Julliard
julliard at winehq.org
Fri Jun 26 09:47:12 CDT 2009
Module: wine
Branch: master
Commit: 349337d7ef3ba9178f92c85d61d93bde7528e4b4
URL: http://source.winehq.org/git/wine.git/?a=commit;h=349337d7ef3ba9178f92c85d61d93bde7528e4b4
Author: Austin English <austinenglish at gmail.com>
Date: Fri Jun 26 03:55:12 2009 -0500
winex11: Make sure GetKeyNameText gets the correct length to return.
---
dlls/winex11.drv/keyboard.c | 6 +-----
1 files changed, 1 insertions(+), 5 deletions(-)
diff --git a/dlls/winex11.drv/keyboard.c b/dlls/winex11.drv/keyboard.c
index 8a6dd37..3ffa13c 100644
--- a/dlls/winex11.drv/keyboard.c
+++ b/dlls/winex11.drv/keyboard.c
@@ -2349,11 +2349,7 @@ INT CDECL X11DRV_GetKeyNameText(LONG lParam, LPWSTR lpBuffer, INT nSize)
TRACE("found scan=%04x keyc=%04x keysym=%04x string=%s\n",
scanCode, keyc, (int)keys, name);
if (lpBuffer && nSize && name)
- {
- MultiByteToWideChar(CP_UNIXCP, 0, name, -1, lpBuffer, nSize);
- lpBuffer[nSize - 1] = 0;
- return nSize;
- }
+ return MultiByteToWideChar(CP_UNIXCP, 0, name, -1, lpBuffer, nSize);
}
/* Finally issue WARN for unknown keys */
More information about the wine-cvs
mailing list