diff --git a/shared/gasync/src/input/windows/rawinput.c b/shared/gasync/src/input/windows/rawinput.c index 6a2763a1..44d7a8a5 100644 --- a/shared/gasync/src/input/windows/rawinput.c +++ b/shared/gasync/src/input/windows/rawinput.c @@ -407,11 +407,11 @@ static SP_DEVINFO_DATA * get_devinfo_data(const char * instanceId) { static char * utf16le_to_utf8(const unsigned char * inbuf, size_t insize) { char * outbuf = NULL; - int outsize = WideCharToMultiByte(CP_UTF8, 0, (LPCWSTR ) inbuf, insize, NULL, 0, NULL, NULL); + int outsize = WideCharToMultiByte(CP_UTF8, 0, (LPCWSTR ) inbuf, -1, NULL, 0, NULL, NULL); if (outsize != 0) { outbuf = (char*) malloc(outsize); if (outbuf != NULL) { - int res = WideCharToMultiByte(CP_UTF8, 0, (LPCWSTR ) inbuf, insize, outbuf, outsize, NULL, NULL); + int res = WideCharToMultiByte(CP_UTF8, 0, (LPCWSTR ) inbuf, -1, outbuf, outsize, NULL, NULL); if (res == 0) { PRINT_ERROR_GETLASTERROR("WideCharToMultiByte") free(outbuf);