winex11: Make sure GetKeyNameText gets the correct length to return.

This commit is contained in:
Austin English 2009-06-26 03:55:12 -05:00 committed by Alexandre Julliard
parent 7363b6e2e3
commit 349337d7ef
1 changed files with 1 additions and 5 deletions

View File

@ -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 */