Commit 514491bd0ea877e1bc8e87318b6e756a6723b704

Con Kolivas 2013-06-03T16:01:20

Only adjust cursor positions with curses locked.

diff --git a/cgminer.c b/cgminer.c
index d4bdd77..c95878f 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -2186,12 +2186,15 @@ static void check_winsizes(void)
 
 static void switch_compact(void)
 {
-	if (opt_compact) {
-		logstart = devcursor + 1;
-		logcursor = logstart + 1;
-	} else {
-		logstart = devcursor + total_devices + 1;
-		logcursor = logstart + 1;
+	if (curses_active_locked()) {
+		if (opt_compact) {
+			logstart = devcursor + 1;
+			logcursor = logstart + 1;
+		} else {
+			logstart = devcursor + total_devices + 1;
+			logcursor = logstart + 1;
+		}
+		unlock_curses();
 	}
 	check_winsizes();
 }