From b5517af02498b1b09380410200b2173034cfcc90 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Sun, 29 Jul 2012 21:07:24 +1000 Subject: [PATCH] Don't try and print curses output for devices that won't fit on the screen. --- cgminer.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cgminer.c b/cgminer.c index edfe4e39..cfcef1b5 100644 --- a/cgminer.c +++ b/cgminer.c @@ -1458,11 +1458,12 @@ static void curses_print_devstatus(int thr_id) struct cgpu_info *cgpu = thr_info[thr_id].cgpu; char logline[255]; + if (devcursor + cgpu->cgminer_id > LINES - 2) + return; + cgpu->utility = cgpu->accepted / ( total_secs ? total_secs : 1 ) * 60; - /* Check this isn't out of the window size */ - if (wmove(statuswin,devcursor + cgpu->cgminer_id, 0) == ERR) - return; + wmove(statuswin,devcursor + cgpu->cgminer_id, 0); wprintw(statuswin, " %s %*d: ", cgpu->api->name, dev_width, cgpu->device_id); if (cgpu->api->get_statline_before) { logline[0] = '\0';