Browse Source

Catch invalid cursor positions

Jochen Sprickerhof 5 years ago
parent
commit
a4faed60e3
1 changed files with 3 additions and 0 deletions
  1. 3 0
      scroll.c

+ 3 - 0
scroll.c

@@ -232,6 +232,9 @@ getcursorposition(int *x, int *y)
 
 	if (sscanf(input, "\033[%d;%dR", x, y) != 2)
 		die("parsing cursor position");
+
+	if (x <= 0 || y <= 0)
+		die("invalid cursor position");
 }
 
 void