Fixed zero CRC matching in the controller mapping database

main
Sam Lantinga 2022-08-24 15:28:56 -07:00
parent a4f84803c4
commit e7332cd814
1 changed files with 1 additions and 3 deletions

View File

@ -675,10 +675,8 @@ static ControllerMapping_t *SDL_PrivateGetControllerMappingForGUID(SDL_JoystickG
/* Now check for match with no CRC */ /* Now check for match with no CRC */
SDL_memcpy(&zero_crc_guid, &guid, sizeof(guid)); SDL_memcpy(&zero_crc_guid, &guid, sizeof(guid));
zero_crc_guid.data[2] = 0;
zero_crc_guid.data[3] = 0; zero_crc_guid.data[3] = 0;
zero_crc_guid.data[4] = 0;
zero_crc_guid.data[5] = 0;
zero_crc_guid.data[6] = 0;
for (mapping = s_pSupportedControllers; mapping; mapping = mapping->next) { for (mapping = s_pSupportedControllers; mapping; mapping = mapping->next) {
if (SDL_memcmp(&zero_crc_guid, &mapping->guid, sizeof(guid)) == 0) { if (SDL_memcmp(&zero_crc_guid, &mapping->guid, sizeof(guid)) == 0) {
return mapping; return mapping;