diff options
author | ache <ache@FreeBSD.org> | 1994-11-18 22:49:09 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 1994-11-18 22:49:09 +0000 |
commit | 91b9eb92f43345882357121dd712708ae202ae6d (patch) | |
tree | 4db83f865d0f5ad4fba44d77b8115e235a3ec60e /gnu | |
parent | 0b8b8f01eece5d1458fa785e8069b1cd9a8373e0 (diff) | |
download | FreeBSD-src-91b9eb92f43345882357121dd712708ae202ae6d.zip FreeBSD-src-91b9eb92f43345882357121dd712708ae202ae6d.tar.gz |
silently restrict all boxes to LINES, COLS
Diffstat (limited to 'gnu')
-rw-r--r-- | gnu/lib/libdialog/checklist.c | 4 | ||||
-rw-r--r-- | gnu/lib/libdialog/inputbox.c | 4 | ||||
-rw-r--r-- | gnu/lib/libdialog/menubox.c | 4 | ||||
-rw-r--r-- | gnu/lib/libdialog/msgbox.c | 4 | ||||
-rw-r--r-- | gnu/lib/libdialog/prgbox.c | 4 | ||||
-rw-r--r-- | gnu/lib/libdialog/radiolist.c | 4 | ||||
-rw-r--r-- | gnu/lib/libdialog/textbox.c | 4 | ||||
-rw-r--r-- | gnu/lib/libdialog/yesno.c | 4 |
8 files changed, 32 insertions, 0 deletions
diff --git a/gnu/lib/libdialog/checklist.c b/gnu/lib/libdialog/checklist.c index 61a636b..c31a930 100644 --- a/gnu/lib/libdialog/checklist.c +++ b/gnu/lib/libdialog/checklist.c @@ -70,6 +70,10 @@ int dialog_checklist(unsigned char *title, unsigned char *prompt, int height, in width = MAX(width,check_x+4)+4; } + if (width > COLS) + width = COLS; + if (height > LINES) + height = LINES; /* center dialog box on screen */ x = (COLS - width)/2; y = (LINES - height)/2; diff --git a/gnu/lib/libdialog/inputbox.c b/gnu/lib/libdialog/inputbox.c index 3e5895d..61dd2f2 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; diff --git a/gnu/lib/libdialog/menubox.c b/gnu/lib/libdialog/menubox.c index fdb9f05..ed82ae5 100644 --- a/gnu/lib/libdialog/menubox.c +++ b/gnu/lib/libdialog/menubox.c @@ -60,6 +60,10 @@ int dialog_menu(unsigned char *title, unsigned char *prompt, int height, int wid width = MAX(width,tag_x+4)+4; } + if (width > COLS) + width = COLS; + if (height > LINES) + height = LINES; /* center dialog box on screen */ x = (COLS - width)/2; y = (LINES - height)/2; diff --git a/gnu/lib/libdialog/msgbox.c b/gnu/lib/libdialog/msgbox.c index fda3b40..50f6c13 100644 --- a/gnu/lib/libdialog/msgbox.c +++ b/gnu/lib/libdialog/msgbox.c @@ -40,6 +40,10 @@ int dialog_msgbox(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; diff --git a/gnu/lib/libdialog/prgbox.c b/gnu/lib/libdialog/prgbox.c index 0145389..53275bf 100644 --- a/gnu/lib/libdialog/prgbox.c +++ b/gnu/lib/libdialog/prgbox.c @@ -39,6 +39,10 @@ int dialog_prgbox(unsigned char *title, const unsigned char *line, int height, i fprintf(stderr, "\nAutosizing is impossible in dialog_prgbox().\n"); exit(-1); } + if (width > COLS) + width = COLS; + if (height > LINES) + height = LINES; /* center dialog box on screen */ x = (COLS - width)/2; y = (LINES - height)/2; diff --git a/gnu/lib/libdialog/radiolist.c b/gnu/lib/libdialog/radiolist.c index 54fce38..5b8a68f 100644 --- a/gnu/lib/libdialog/radiolist.c +++ b/gnu/lib/libdialog/radiolist.c @@ -78,6 +78,10 @@ int dialog_radiolist(unsigned char *title, unsigned char *prompt, int height, in width = MAX(width,check_x+4)+4; } + if (width > COLS) + width = COLS; + if (height > LINES) + height = LINES; /* center dialog box on screen */ x = (COLS - width)/2; y = (LINES - height)/2; 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; 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; |