Skip to content

Commit

Permalink
Don't try and print curses output for devices that won't fit on the s…
Browse files Browse the repository at this point in the history
…creen.
  • Loading branch information
ckolivas committed Jul 29, 2012
1 parent 2fb95c0 commit b5517af
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cgminer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

0 comments on commit b5517af

Please sign in to comment.