remove maxx and maxy global variables

The maxx and maxy variables are already global functions defined in
the ncurses library. They are accessible through the getmaxyx macro.
Is it not needed to add two more global variables to our code, let's
use the code ncurses gives to us.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
diff --git a/display.c b/display.c
index 1af12a3..bd5971a 100644
--- a/display.c
+++ b/display.c
@@ -37,8 +37,6 @@
 static WINDOW *main_win;
 static int current_win;
 
-int maxx, maxy;
-
 /* Number of lines in the virtual window */
 static const int maxrows = 1024;
 
@@ -119,6 +117,10 @@
 
 int display_refresh_pad(int win)
 {
+	int maxx, maxy;
+
+	getmaxyx(stdscr, maxy, maxx);
+
 	return prefresh(windata[win].pad, windata[win].scrolling,
 			0, 2, 0, maxy - 2, maxx);
 }
@@ -168,11 +170,14 @@
 
 static int display_next_line(void)
 {
+	int maxx, maxy;
 	int cursor = windata[current_win].cursor;
 	int nrdata = windata[current_win].nrdata;
 	int scrolling = windata[current_win].scrolling;
 	struct rowdata *rowdata = windata[current_win].rowdata;
 
+	getmaxyx(stdscr, maxy, maxx);
+
 	if (cursor >= nrdata)
 		return cursor;
 
@@ -309,7 +314,7 @@
 
 int display_init(int wdefault)
 {
-	int i;
+	int i, maxx, maxy;
 	size_t array_size = sizeof(windata) / sizeof(windata[0]);
 
 	current_win = wdefault;