Ver Fonte

Fix segfault when pressing PrintScr without a selection

Rafa Garcia Gallego há 11 anos atrás
pai
commit
672e4e4b03
1 ficheiros alterados com 4 adições e 3 exclusões
  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