diff --git a/dlls/dinput/joystick.c b/dlls/dinput/joystick.c index 433348cd043..a5308b6cc48 100644 --- a/dlls/dinput/joystick.c +++ b/dlls/dinput/joystick.c @@ -700,7 +700,7 @@ HRESULT WINAPI JoystickAGenericImpl_GetDeviceInfo( /* we only support traditional joysticks for now */ pdidi->dwDevType = This->devcaps.dwDevType; snprintf(pdidi->tszInstanceName, MAX_PATH, "Joystick %d", index); - strcpy(pdidi->tszProductName, This->name); + lstrcpynA(pdidi->tszProductName, This->name, MAX_PATH); if (pdidi->dwSize > sizeof(DIDEVICEINSTANCE_DX3A)) { pdidi->guidFFDriver = GUID_NULL; pdidi->wUsagePage = 0; diff --git a/dlls/dinput/joystick_linuxinput.c b/dlls/dinput/joystick_linuxinput.c index e3371b9f441..1e8c542f21d 100644 --- a/dlls/dinput/joystick_linuxinput.c +++ b/dlls/dinput/joystick_linuxinput.c @@ -411,8 +411,8 @@ static void fill_joystick_dideviceinstanceA(LPDIDEVICEINSTANCEA lpddi, DWORD ver lpddi->guidInstance = lpddiW.guidInstance; lpddi->guidProduct = lpddiW.guidProduct; lpddi->dwDevType = lpddiW.dwDevType; - strcpy(lpddi->tszInstanceName, joydevs[id].name); - strcpy(lpddi->tszProductName, joydevs[id].name); + lstrcpynA(lpddi->tszInstanceName, joydevs[id].name, MAX_PATH); + lstrcpynA(lpddi->tszProductName, joydevs[id].name, MAX_PATH); lpddi->guidFFDriver = lpddiW.guidFFDriver; lpddi->wUsagePage = lpddiW.wUsagePage; lpddi->wUsage = lpddiW.wUsage;