From 50fbf29b3b0ffabf0600e1f419acea304825966d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valentin=20Gr=C3=BCnbacher?= Date: Thu, 22 May 2014 00:07:37 +0200 Subject: [PATCH] Newmenus: Fix unsigned underflow on "end" variable --- amxmodx/newmenus.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/amxmodx/newmenus.cpp b/amxmodx/newmenus.cpp index 681fcea1..0cbba984 100755 --- a/amxmodx/newmenus.cpp +++ b/amxmodx/newmenus.cpp @@ -361,13 +361,13 @@ const char *Menu::GetTextString(int player, page_t page, int &keys) { if (start + items_per_page >= numItems) { - end = numItems - 1; + end = numItems; flags &= ~Display_Next; } else { - end = start + items_per_page - 1; + end = start + items_per_page; } } else { - end = numItems - 1; + end = numItems; if (end > 10) { end = 10; @@ -388,7 +388,7 @@ const char *Menu::GetTextString(int player, page_t page, int &keys) int slots = 0; int option_display = 0; - for (item_t i = start; i <= end; i++) + for (item_t i = start; i < end; i++) { // reset enabled enabled = true;