diff --git a/desmume/src/slot2.cpp b/desmume/src/slot2.cpp index 8dd6ce993..4640b5a0b 100644 --- a/desmume/src/slot2.cpp +++ b/desmume/src/slot2.cpp @@ -106,7 +106,7 @@ void slot2_Reset() bool slot2_Change(NDS_SLOT2_TYPE changeToType) { - if (changeToType > NDS_SLOT2_COUNT || changeToType < 0) + if (changeToType >= NDS_SLOT2_COUNT || changeToType < 0) return false; if (slot2_device_type == changeToType) @@ -163,7 +163,7 @@ bool slot2_Change(NDS_SLOT2_TYPE changeToType) void slot2_setDeviceByType(NDS_SLOT2_TYPE theType) { - if (theType > NDS_SLOT2_COUNT || theType < 0) + if (theType >= NDS_SLOT2_COUNT || theType < 0) { return; }