Skip to content

Commit

Permalink
Merge pull request #4101 from meffij/SIDevicesEnumFix
Browse files Browse the repository at this point in the history
clean up bounds checking for SIDEVICE_ENUM
  • Loading branch information
phire committed Aug 8, 2016
2 parents 1ab99ee + ba45a59 commit d56ae50
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Source/Core/Core/BootManager.cpp
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions Source/Core/Core/HW/SI_Device.h
Expand Up @@ -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
Expand Down

0 comments on commit d56ae50

Please sign in to comment.