summaryrefslogtreecommitdiffstats
path: root/gnu/lib/libdialog/yesno.c
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1994-11-18 22:49:09 +0000
committerache <ache@FreeBSD.org>1994-11-18 22:49:09 +0000
commit91b9eb92f43345882357121dd712708ae202ae6d (patch)
tree4db83f865d0f5ad4fba44d77b8115e235a3ec60e /gnu/lib/libdialog/yesno.c
parent0b8b8f01eece5d1458fa785e8069b1cd9a8373e0 (diff)
downloadFreeBSD-src-91b9eb92f43345882357121dd712708ae202ae6d.zip
FreeBSD-src-91b9eb92f43345882357121dd712708ae202ae6d.tar.gz
silently restrict all boxes to LINES, COLS
Diffstat (limited to 'gnu/lib/libdialog/yesno.c')
-rw-r--r--gnu/lib/libdialog/yesno.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gnu/lib/libdialog/yesno.c b/gnu/lib/libdialog/yesno.c
index 1e4f77d..8d25360 100644
--- a/gnu/lib/libdialog/yesno.c
+++ b/gnu/lib/libdialog/yesno.c
@@ -39,6 +39,10 @@ int dialog_yesno(unsigned char *title, unsigned char * prompt, int height, int w
width = MAX(i,j)+4;
}
+ if (width > COLS)
+ width = COLS;
+ if (height > LINES)
+ height = LINES;
/* center dialog box on screen */
x = (COLS - width)/2;
y = (LINES - height)/2;
OpenPOWER on IntegriCloud