diff --git a/Source/Core/Core/BootManager.cpp b/Source/Core/Core/BootManager.cpp index f443491dfcf7..dae95c785ac3 100644 --- a/Source/Core/Core/BootManager.cpp +++ b/Source/Core/Core/BootManager.cpp @@ -287,7 +287,7 @@ bool BootCore(const std::string& _rFilename) { int source; controls_section->Get(StringFromFormat("PadType%u", i), &source, -1); - if (source >= (int)SIDEVICE_NONE && source <= (int)SIDEVICE_WIIU_ADAPTER) + if (source >= SIDEVICE_NONE && source < SIDEVICE_COUNT) { SConfig::GetInstance().m_SIDevice[i] = (SIDevices)source; config_cache.bSetPads[i] = true; diff --git a/Source/Core/Core/HW/SI_Device.h b/Source/Core/Core/HW/SI_Device.h index d2fadc6ac4df..fe3953494c00 100644 --- a/Source/Core/Core/HW/SI_Device.h +++ b/Source/Core/Core/HW/SI_Device.h @@ -64,6 +64,8 @@ enum SIDevices : int SIDEVICE_GC_TARUKONGA, SIDEVICE_AM_BASEBOARD, SIDEVICE_WIIU_ADAPTER, + // not a valid device, used for checking whether enum value is valid + SIDEVICE_COUNT, }; class ISIDevice