summaryrefslogtreecommitdiffstats
path: root/ui/ncurses
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2014-05-05 11:45:16 +0800
committerJeremy Kerr <jk@ozlabs.org>2014-07-16 08:47:46 +0800
commit71f338ca02092cb75608a511d6885affaf7adb66 (patch)
tree4df90580b21c402dd974aaa1018fc1de6cae30d0 /ui/ncurses
parent49367fdd5034a010a3f7f657f8ad205ebf9a01fe (diff)
downloadtalos-petitboot-71f338ca02092cb75608a511d6885affaf7adb66.tar.gz
talos-petitboot-71f338ca02092cb75608a511d6885affaf7adb66.zip
ui/ncurses: specify a fixed length for status messages
Incoming status messages can be an arbitrary length; if so, the status line may be corrupt. This change uses the 'n' variant of mvwaddnstr(), so we only write one line of characters. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'ui/ncurses')
-rw-r--r--ui/ncurses/nc-scr.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ui/ncurses/nc-scr.c b/ui/ncurses/nc-scr.c
index 41e35de..a02627b 100644
--- a/ui/ncurses/nc-scr.c
+++ b/ui/ncurses/nc-scr.c
@@ -36,8 +36,8 @@ static void nc_scr_status_clear(struct nc_scr *scr)
static void nc_scr_status_draw(struct nc_scr *scr)
{
- mvwaddstr(scr->main_ncw, LINES - nc_scr_pos_status, 1,
- scr->frame.status);
+ mvwaddnstr(scr->main_ncw, LINES - nc_scr_pos_status, 1,
+ scr->frame.status, COLS);
}
int nc_scr_post(struct nc_scr *scr)
OpenPOWER on IntegriCloud