diff --git a/gnu/lib/libdialog/checklist.c b/gnu/lib/libdialog/checklist.c index c31a9305903..964a1b67098 100644 --- a/gnu/lib/libdialog/checklist.c +++ b/gnu/lib/libdialog/checklist.c @@ -65,10 +65,11 @@ int dialog_checklist(unsigned char *title, unsigned char *prompt, int height, in height = strheight(prompt)+list_height+4+2; if (width < 0) { i = strwidth(prompt); - j = strwidth(title); + j = ((title != NULL) ? strwidth(title) : 0); width = MAX(i,j); width = MAX(width,check_x+4)+4; } + width = MAX(width,24); if (width > COLS) width = COLS; diff --git a/gnu/lib/libdialog/inputbox.c b/gnu/lib/libdialog/inputbox.c index 61dd2f21248..b69267f1c95 100644 --- a/gnu/lib/libdialog/inputbox.c +++ b/gnu/lib/libdialog/inputbox.c @@ -37,9 +37,10 @@ int dialog_inputbox(unsigned char *title, unsigned char *prompt, int height, int height = strheight(prompt)+2+4; if (width < 0) { i = strwidth(prompt); - j = strwidth(title); + j = ((title != NULL) ? strwidth(title) : 0); width = MAX(i,j) + 4; } + width = MAX(width,24); if (width > COLS) width = COLS; diff --git a/gnu/lib/libdialog/menubox.c b/gnu/lib/libdialog/menubox.c index ed82ae5670b..22c7bc0285e 100644 --- a/gnu/lib/libdialog/menubox.c +++ b/gnu/lib/libdialog/menubox.c @@ -55,10 +55,11 @@ int dialog_menu(unsigned char *title, unsigned char *prompt, int height, int wid height = strheight(prompt)+menu_height+4+2; if (width < 0) { i = strwidth(prompt); - j = strwidth(title); + j = ((title != NULL) ? strwidth(title) : 0); width = MAX(i,j); width = MAX(width,tag_x+4)+4; } + width = MAX(width,24); if (width > COLS) width = COLS; diff --git a/gnu/lib/libdialog/msgbox.c b/gnu/lib/libdialog/msgbox.c index 50f6c13b205..f8ca26fc557 100644 --- a/gnu/lib/libdialog/msgbox.c +++ b/gnu/lib/libdialog/msgbox.c @@ -36,9 +36,11 @@ int dialog_msgbox(unsigned char *title, unsigned char *prompt, int height, int w height = strheight(prompt)+2+2*(!!pause); if (width < 0) { i = strwidth(prompt); - j = strwidth(title); + j = ((title != NULL) ? strwidth(title) : 0); width = MAX(i,j)+4; } + if (pause) + width = MAX(width,10); if (width > COLS) width = COLS; diff --git a/gnu/lib/libdialog/prgbox.c b/gnu/lib/libdialog/prgbox.c index 53275bfd704..f2c7c6a5fb9 100644 --- a/gnu/lib/libdialog/prgbox.c +++ b/gnu/lib/libdialog/prgbox.c @@ -39,6 +39,8 @@ int dialog_prgbox(unsigned char *title, const unsigned char *line, int height, i fprintf(stderr, "\nAutosizing is impossible in dialog_prgbox().\n"); exit(-1); } + width = MAX(width,10); + if (width > COLS) width = COLS; if (height > LINES) diff --git a/gnu/lib/libdialog/radiolist.c b/gnu/lib/libdialog/radiolist.c index 5b8a68fff56..417f2ab556a 100644 --- a/gnu/lib/libdialog/radiolist.c +++ b/gnu/lib/libdialog/radiolist.c @@ -73,10 +73,11 @@ int dialog_radiolist(unsigned char *title, unsigned char *prompt, int height, in height = strheight(prompt)+list_height+4+2; if (width < 0) { i = strwidth(prompt); - j = strwidth(title); + j = ((title != NULL) ? strwidth(title) : 0); width = MAX(i,j); width = MAX(width,check_x+4)+4; } + width = MAX(width,24); if (width > COLS) width = COLS; diff --git a/gnu/lib/libdialog/yesno.c b/gnu/lib/libdialog/yesno.c index 8d253608e6b..20799b65653 100644 --- a/gnu/lib/libdialog/yesno.c +++ b/gnu/lib/libdialog/yesno.c @@ -35,9 +35,10 @@ int dialog_yesno(unsigned char *title, unsigned char * prompt, int height, int w height = strheight(prompt)+4; if (width < 0) { i = strwidth(prompt); - j = strwidth(title); + j = ((title != NULL) ? strwidth(title) : 0); width = MAX(i,j)+4; } + width = MAX(width,23); if (width > COLS) width = COLS;