diff --git a/src/joystick/windows/SDL_dinputjoystick.c b/src/joystick/windows/SDL_dinputjoystick.c index 1a042ab38..5900a96db 100644 --- a/src/joystick/windows/SDL_dinputjoystick.c +++ b/src/joystick/windows/SDL_dinputjoystick.c @@ -601,8 +601,8 @@ EnumJoysticksCallback(const DIDEVICEINSTANCE * pdidInstance, VOID * pContext) pPrevJoystick->pNext = pNewJoystick->pNext; } - // Update with new guid/etc, if it has changed - pNewJoystick->dxdevice = *pdidInstance; + /* Update with new guid/etc, if it has changed */ + SDL_memcpy(&pNewJoystick->dxdevice, pdidInstance, sizeof(DIDEVICEINSTANCE)); pNewJoystick->pNext = SYS_Joystick; SYS_Joystick = pNewJoystick;