X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=gui.c;h=c8721565ae86502319be0ed2e6257454b876f841;hp=eba1e2a59331564a40677a123d1220dc9120c059;hb=e3272a316d113dd9c0c6f01f3087ab14f945e76b;hpb=b4a05b0b792d1890be868b9763feb119064ff863 diff --git a/gui.c b/gui.c index eba1e2a5..c8721565 100644 --- a/gui.c +++ b/gui.c @@ -9,7 +9,6 @@ #include #include #include -#include #include #include "gui.cmdline.h" @@ -22,6 +21,7 @@ #include "list.h" #include "sched.h" #include "signal.h" +#include "version.h" /** define the array of error lists needed by para_gui */ INIT_GUI_ERRLISTS; @@ -33,10 +33,10 @@ static int signal_pipe; static struct win_data { WINDOW *win; - NCURSES_SIZE_T begx; - NCURSES_SIZE_T begy; - NCURSES_SIZE_T cols; - NCURSES_SIZE_T lines; + size_t begx; + size_t begy; + size_t cols; + size_t lines; } top, bot, sb, in, sep; #define RINGBUFFER_SIZE 512 @@ -400,11 +400,13 @@ static int draw_top_rbe(unsigned *lines) rbe = ringbuffer_get(bot_win_rb, fvr); if (!rbe) return -1; - /* first rbe might be only partially visible */ - offset = (*lines - bot.lines) * bot.cols; len = strlen(rbe->msg); - if (offset < 0 || len < offset) - return -1; + if (*lines > bot.lines) { + /* first rbe is only partially visible */ + offset = (*lines - bot.lines) * bot.cols; + assert(offset <= len); + } else + offset = 0; wattron(bot.win, COLOR_PAIR(rbe->color)); waddstr(bot.win, rbe->msg + offset); *lines = NUM_LINES(len - offset);