Explorar o código

add additional information in die calls for debugging

Jan Klemkow %!s(int64=5) %!d(string=hai) anos
pai
achega
200c1a9227
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      scroll.c

+ 2 - 2
scroll.c

@@ -231,10 +231,10 @@ getcursorposition(int *x, int *y)
 	input[n] = '\0';
 
 	if (sscanf(input, "\033[%d;%dR", x, y) != 2)
-		die("parsing cursor position");
+		die("parsing cursor position: %s", input);
 
 	if (x <= 0 || y <= 0)
-		die("invalid cursor position");
+		die("invalid cursor position: x=%d y=%d", x, y);
 }
 
 void