From 5b6c056cabc11a0d20356a1f977b09f2e92a496d Mon Sep 17 00:00:00 2001 From: Pierre-Alexandre Meyer Date: Thu, 3 Sep 2009 14:31:27 -0700 Subject: [PATCH] hdt: remove call to legacy getnumcols (menu) Use getscreensize instead. Signed-off-by: Pierre-Alexandre Meyer --- com32/hdt/hdt-menu.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/com32/hdt/hdt-menu.c b/com32/hdt/hdt-menu.c index e3521dc..55031d6 100644 --- a/com32/hdt/hdt-menu.c +++ b/com32/hdt/hdt-menu.c @@ -27,6 +27,7 @@ */ #include "hdt-menu.h" +#include int start_menu_mode(struct s_hardware *hardware, char *version_string) { @@ -86,7 +87,7 @@ TIMEOUTCODE ontimeout() /* Keyboard handler for the menu system */ void keys_handler(t_menuitem * mi, unsigned int scancode) { - char nc; + int nr, nc; if ((scancode >> 8) == F1) { // If scancode of F1 runhelpsystem(mi->helpid); @@ -97,7 +98,11 @@ void keys_handler(t_menuitem * mi, unsigned int scancode) */ if (((scancode & 0xFF) == 0x09) && (mi->action == OPT_RUN)) { //(isallowed(username,"editcmd") || isallowed(username,"root"))) { - nc = getnumcols(); + if (getscreensize(1, &nr, &nc)) { + /* Unknown screen size? */ + nc = 80; + nr = 24; + } /* User typed TAB and has permissions to edit command line */ gotoxy(EDITPROMPT, 1); csprint("Command line:", 0x07); -- 2.7.4