From c78ca2d1700322ee906a2e83e9181ed5fbf7e6c6 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 1 Dec 2020 13:38:42 -0800 Subject: [PATCH] Fixed bug 5371 - Rawinput: Fix truncating cast of string length. Joel Linn Fixes an implicit truncation of a string length on 64bit systems. --- src/joystick/windows/SDL_rawinputjoystick.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/joystick/windows/SDL_rawinputjoystick.c b/src/joystick/windows/SDL_rawinputjoystick.c index 6311517e9..746f409c7 100644 --- a/src/joystick/windows/SDL_rawinputjoystick.c +++ b/src/joystick/windows/SDL_rawinputjoystick.c @@ -553,7 +553,7 @@ RAWINPUT_InitWindowsGamingInput(RAWINPUT_DeviceContext *ctx) LPTSTR pNamespace = L"Windows.Gaming.Input.Gamepad"; HSTRING hNamespaceString; - hr = WindowsCreateStringFunc(pNamespace, SDL_wcslen(pNamespace), &hNamespaceString); + hr = WindowsCreateStringFunc(pNamespace, (UINT32)SDL_wcslen(pNamespace), &hNamespaceString); if (SUCCEEDED(hr)) { RoGetActivationFactoryFunc(hNamespaceString, &SDL_IID_IGamepadStatics, &wgi_state.gamepad_statics); WindowsDeleteStringFunc(hNamespaceString);