summaryrefslogtreecommitdiffstats
path: root/gnu/lib/libdialog/radiolist.c
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1995-01-30 14:11:58 +0000
committerache <ache@FreeBSD.org>1995-01-30 14:11:58 +0000
commit6a9b44b167288f88d9f4bfb9d92009ee6fbc4030 (patch)
tree8fef152ce7e55c355dc552942299c434c3426349 /gnu/lib/libdialog/radiolist.c
parent48859413cdeec6161df494fba1da66bead5b8ee3 (diff)
downloadFreeBSD-src-6a9b44b167288f88d9f4bfb9d92009ee6fbc4030.zip
FreeBSD-src-6a9b44b167288f88d9f4bfb9d92009ee6fbc4030.tar.gz
Add more range/argument checking
Submitted by: charnier@lirmm.fr
Diffstat (limited to 'gnu/lib/libdialog/radiolist.c')
-rw-r--r--gnu/lib/libdialog/radiolist.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gnu/lib/libdialog/radiolist.c b/gnu/lib/libdialog/radiolist.c
index 5b8a68f..417f2ab 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;
OpenPOWER on IntegriCloud