From: Miroslav Lichvar Date: Thu, 24 Nov 2022 15:43:00 +0000 (+0100) Subject: fix automatic width in whiptail with unicode characters X-Git-Tag: r0-52-23~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ce98a323adfeb4de978aa2aea0e6275df5b010d4;p=thirdparty%2Fnewt.git fix automatic width in whiptail with unicode characters --- diff --git a/whiptail.c b/whiptail.c index 03a9c9b..804bde4 100644 --- a/whiptail.c +++ b/whiptail.c @@ -214,8 +214,8 @@ static int menuSize(int * height, int * width, int * listHeight, overhead = 5; while ( argv[0] != 0 && argv[1] ) { - tagWidth = max(tagWidth, strlen(argv[0])); - descriptionWidth = max(descriptionWidth, strlen(argv[1])); + tagWidth = max(tagWidth, _newt_wstrlen(argv[0], -1)); + descriptionWidth = max(descriptionWidth, _newt_wstrlen(argv[1], -1)); if ( mode == MODE_MENU ) argv += 2;