Reverse order of conditions to avoid integer overflow giving a fals positive

Thanks to @fosnola for spotting this.
This commit is contained in:
2023-01-18 20:56:21 -05:00
parent a6196832de
commit 9536b79096

View File

@@ -388,8 +388,7 @@ static void put_item_graphics(cDialog& me, size_t& first_item_shown, short& curr
if(first_item_shown == 0)
me["up"].hide();
else me["up"].show();
if(first_item_shown > item_array.size() - 7 ||
item_array.size() <= 8)
if(item_array.size() <= 8 || first_item_shown > item_array.size() - 7)
me["down"].hide();
else me["down"].show();