From 832b91b0332103d43fab344d37c5b22eeaf7a4f6 Mon Sep 17 00:00:00 2001 From: Yorhel <git@yorhel.nl> Date: Sat, 18 Aug 2012 08:55:51 +0200 Subject: [PATCH] Make width of scan error screen dynamic as well --- src/calc.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/calc.c b/src/calc.c index 5047d0a..07cf9a3 100644 --- a/src/calc.c +++ b/src/calc.c @@ -335,15 +335,16 @@ static void calc_draw_progress() { static void calc_draw_error(char *cur, char *msg) { - nccreate(7, 60, "Error!"); + int width = wincols-5; + nccreate(7, width, "Error!"); attron(A_BOLD); ncaddstr(2, 2, "Error:"); attroff(A_BOLD); - ncprint(2, 9, "could not open %s", cropstr(cur, 34)); - ncprint(3, 4, "%s", cropstr(msg, 52)); - ncaddstr(5, 30, "press any key to continue..."); + ncprint(2, 9, "could not open %s", cropstr(cur, width-26)); + ncprint(3, 4, "%s", cropstr(msg, width-8)); + ncaddstr(5, width-30, "press any key to continue..."); } -- GitLab