X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=gui.c;h=4be81f749da4bfd244443973b0a6acb0c9207439;hp=eba1e2a59331564a40677a123d1220dc9120c059;hb=be9f7c9b442f7b723427a79f85774d5fa7718425;hpb=6f91c2901355ace99756041534ddc6551bbc4bc0 diff --git a/gui.c b/gui.c index eba1e2a5..4be81f74 100644 --- a/gui.c +++ b/gui.c @@ -22,6 +22,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; @@ -400,11 +401,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);