]> git.ipfire.org Git - thirdparty/newt.git/commitdiff
don't modify popt args in whiptail
authorMiroslav Lichvar <mlichvar@redhat.com>
Mon, 21 Nov 2022 11:21:05 +0000 (12:21 +0100)
committerMiroslav Lichvar <mlichvar@redhat.com>
Mon, 21 Nov 2022 13:32:51 +0000 (14:32 +0100)
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

index 627f1eeee598e759db564b13534571b120f22c3d..8d3d2560b13c6dcbda76b1fd68ba21381b7f231b 100644 (file)
@@ -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;
 }