Fixed warning C6001: Using uninitialized memory 'rdi'.

main
Sam Lantinga 2023-12-04 21:45:39 -08:00
parent e29393e407
commit 163de8e697
1 changed files with 2 additions and 1 deletions

View File

@ -852,7 +852,7 @@ static void RAWINPUT_AddDevice(HANDLE hDevice)
SDL_RAWINPUT_Device *curr, *last; SDL_RAWINPUT_Device *curr, *last;
RID_DEVICE_INFO rdi; RID_DEVICE_INFO rdi;
UINT size; UINT size;
char dev_name[MAX_PATH]; char dev_name[MAX_PATH] = { 0 };
HANDLE hFile = INVALID_HANDLE_VALUE; HANDLE hFile = INVALID_HANDLE_VALUE;
/* Make sure we're not trying to add the same device twice */ /* Make sure we're not trying to add the same device twice */
@ -862,6 +862,7 @@ static void RAWINPUT_AddDevice(HANDLE hDevice)
/* Figure out what kind of device it is */ /* Figure out what kind of device it is */
size = sizeof(rdi); size = sizeof(rdi);
SDL_zero(rdi);
CHECK(GetRawInputDeviceInfoA(hDevice, RIDI_DEVICEINFO, &rdi, &size) != (UINT)-1); CHECK(GetRawInputDeviceInfoA(hDevice, RIDI_DEVICEINFO, &rdi, &size) != (UINT)-1);
CHECK(rdi.dwType == RIM_TYPEHID); CHECK(rdi.dwType == RIM_TYPEHID);