#include <regex.h>
#include <signal.h>
#include <sys/types.h>
-#include <dirent.h>
#include <curses.h>
#include "gui.cmdline.h"
#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;
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
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);