aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/config/lxdialog/textbox.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2015-01-08 14:33:53 +0000
committerFelix Fietkau <nbd@openwrt.org>2015-01-08 14:33:53 +0000
commita9f6941436e83d2f91caf06c13bee86cad309064 (patch)
tree8f3b14ce3f98718cc2513344b82ceb703638ba9b /scripts/config/lxdialog/textbox.c
parent3f26960a5c8db5b7cbdf120ddcd7feaadca51c8f (diff)
downloadupstream-a9f6941436e83d2f91caf06c13bee86cad309064.tar.gz
upstream-a9f6941436e83d2f91caf06c13bee86cad309064.tar.bz2
upstream-a9f6941436e83d2f91caf06c13bee86cad309064.zip
scripts/config: sync with linux upstream
Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 43873
Diffstat (limited to 'scripts/config/lxdialog/textbox.c')
-rw-r--r--scripts/config/lxdialog/textbox.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/scripts/config/lxdialog/textbox.c b/scripts/config/lxdialog/textbox.c
index a48bb93e09..1773319b95 100644
--- a/scripts/config/lxdialog/textbox.c
+++ b/scripts/config/lxdialog/textbox.c
@@ -80,7 +80,7 @@ int dialog_textbox(const char *title, char *tbuf, int initial_height,
do_resize:
getmaxyx(stdscr, height, width);
- if (height < 8 || width < 8)
+ if (height < TEXTBOX_HEIGTH_MIN || width < TEXTBOX_WIDTH_MIN)
return -ERRDISPLAYTOOSMALL;
if (initial_height != 0)
height = initial_height;
@@ -98,8 +98,8 @@ do_resize:
width = 0;
/* center dialog box on screen */
- x = (COLS - width) / 2;
- y = (LINES - height) / 2;
+ x = (getmaxx(stdscr) - width) / 2;
+ y = (getmaxy(stdscr) - height) / 2;
draw_shadow(stdscr, y, x, height, width);