summaryrefslogtreecommitdiff
path: root/src/menus.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/menus.c')
-rw-r--r--src/menus.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/menus.c b/src/menus.c
index 34a3c8e..395426f 100644
--- a/src/menus.c
+++ b/src/menus.c
@@ -920,7 +920,7 @@ MakeMenu(MenuRoot *mr)
b3.flags = DoRed | DoGreen | DoBlue;
num -= 1;
- for (i = 0, cur = start->next; i < num; i++, cur = cur->next)
+ for (i = 0, cur = start->next; i < num && cur; i++, cur = cur->next)
{
f3.red += fred;
f3.green += fgreen;