summaryrefslogtreecommitdiff
path: root/gnu/lib/libdialog/inputbox.c
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/lib/libdialog/inputbox.c')
-rw-r--r--gnu/lib/libdialog/inputbox.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gnu/lib/libdialog/inputbox.c b/gnu/lib/libdialog/inputbox.c
index 3e5895d3e0ab..61dd2f21248f 100644
--- a/gnu/lib/libdialog/inputbox.c
+++ b/gnu/lib/libdialog/inputbox.c
@@ -41,6 +41,10 @@ int dialog_inputbox(unsigned char *title, unsigned char *prompt, int height, int
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;