From 91b9eb92f43345882357121dd712708ae202ae6d Mon Sep 17 00:00:00 2001 From: ache Date: Fri, 18 Nov 1994 22:49:09 +0000 Subject: silently restrict all boxes to LINES, COLS --- gnu/lib/libdialog/textbox.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'gnu/lib/libdialog/textbox.c') diff --git a/gnu/lib/libdialog/textbox.c b/gnu/lib/libdialog/textbox.c index 099f98e..0479723 100644 --- a/gnu/lib/libdialog/textbox.c +++ b/gnu/lib/libdialog/textbox.c @@ -89,6 +89,10 @@ int dialog_textbox(unsigned char *title, unsigned char *file, int height, int wi buf[bytes_read] = '\0'; /* mark end of valid data */ page = buf; /* page is pointer to start of page to be displayed */ + if (width > COLS) + width = COLS; + if (height > LINES) + height = LINES; /* center dialog box on screen */ x = (COLS - width)/2; y = (LINES - height)/2; -- cgit v1.1