From cf2057b39553e9f21a2079796f9d754d3d33bb55 Mon Sep 17 00:00:00 2001 From: John Haugabook Date: Wed, 30 Jul 2025 12:33:34 -0400 Subject: [PATCH] redefine col_num for uneven rows In first for loop of print_cheatsheet(), redefine col_num if current iteration is null, and break the loop. --- src/tool_help.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/tool_help.c b/src/tool_help.c index 2428694f50..a1cfde514c 100644 --- a/src/tool_help.c +++ b/src/tool_help.c @@ -446,6 +446,10 @@ static void print_cheatsheet(int i, int col_num) /* The headers */ if(cheat_items[c + i].heading[0]) printf("%-30s ", cheat_items[c + i].heading[0]); + else { + col_num = c; /* redefine for uneven rows */ + break; + } } puts(""); for(c = 0; c < col_num; c++)