Fix integer underflow in the WUPSConfigItemMultipleValues

This commit is contained in:
Maschell 2018-09-14 12:59:37 +02:00
parent 44f373d3e2
commit 0d80bd2183

View File

@ -91,9 +91,8 @@ void WUPSConfigItemMultipleValues::onSelected(bool isSelected) {
void WUPSConfigItemMultipleValues::onButtonPressed(WUPSConfigButtons buttons) {
uint32_t previousValue = valueIndex;
if(buttons & WUPS_CONFIG_BUTTON_LEFT) {
valueIndex--;
if(valueIndex < 0) {
valueIndex = 0;
if(valueIndex != 0){
valueIndex--;
}
}
if(buttons & WUPS_CONFIG_BUTTON_RIGHT && values.size() > 0) {