X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=gui.c;h=38addd9815cc5bf2775c80278679a1e9c64e872e;hp=eba1e2a59331564a40677a123d1220dc9120c059;hb=01bd4cba7946f6506f4ca3095104904bf3b2b098;hpb=b4a05b0b792d1890be868b9763feb119064ff863 diff --git a/gui.c b/gui.c index eba1e2a5..38addd98 100644 --- a/gui.c +++ b/gui.c @@ -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);