Explorar o código

Fix segfault when pressing PrintScr without a selection

Rafa Garcia Gallego %!s(int64=11) %!d(string=hai) anos
pai
achega
672e4e4b03
Modificáronse 1 ficheiros con 4 adicións e 3 borrados
  1. 4 3
      st.c

+ 4 - 3
st.c

@@ -2263,9 +2263,10 @@ tdumpsel(void)
 {
 	char *ptr;
 
-	ptr = getsel();
-	tprinter(ptr, strlen(ptr));
-	free(ptr);
+	if((ptr = getsel())) {
+		tprinter(ptr, strlen(ptr));
+		free(ptr);
+	}
 }
 
 void