From 3f5d1d27f09b06714c58b80f674fe1526ec9f07f Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Mon, 21 Nov 2022 12:21:05 +0100 Subject: [PATCH] don't modify popt args in whiptail Remove code that replaces the first popt argument with a string containing a part of the menu height (for some debugging purposes?). This fixes a crash with libpopt-1.19. --- whiptail.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/whiptail.c b/whiptail.c index 627f1ee..8d3d256 100644 --- a/whiptail.c +++ b/whiptail.c @@ -202,12 +202,10 @@ static void spaceForButtons(int * height, int * width, int count, int full) { static int menuSize(int * height, int * width, enum mode mode, poptContext options) { const char ** argv = poptGetArgs(options); - const char ** items = argv; int h = 0; int tagWidth = 0; int descriptionWidth = 0; int overhead = 10; - static char buf[20]; if ( argv == 0 || *argv == 0 ) return 0; @@ -232,8 +230,6 @@ static int menuSize(int * height, int * width, enum mode mode, h = min(h, SLtt_Screen_Rows - *height - 4); *height = *height + h + 1; - sprintf(buf, "%d", h); - *items = buf; return 0; } -- 2.39.5