Browse Source

Merge branch 'bfgminer' of github.com:luke-jr/bfgminer into bfgminer

Luke Dashjr 12 years ago
parent
commit
0dc2926063
1 changed files with 5 additions and 0 deletions
  1. 5 0
      miner.c

+ 5 - 0
miner.c

@@ -3622,6 +3622,11 @@ void bfg_wspctoeol(WINDOW * const win, const int offset)
 	getmaxyx(win, y, maxx);
 	getyx(win, y, x);
 	const int space_count = (maxx - x) - offset;
+	
+	// Check for negative - terminal too narrow
+	if (space_count <= 0)
+		return;
+	
 	char buf[space_count];
 	memset(buf, ' ', space_count);
 	waddnstr(win, buf, space_count);