[hackers] [st] Fix segfault when pressing PrintScr without a selection || Rafa Garcia Gallego

From: <git_AT_suckless.org>
Date: Tue, 01 Apr 2014 15:50:10 +0200

commit 672e4e4b03d8987103020d399b2c05c95a9ea2f8
Author: Rafa Garcia Gallego <rafael.garcia.gallego_AT_gmail.com>
Date: Wed Mar 26 23:58:27 2014 +0100

    Fix segfault when pressing PrintScr without a selection

diff --git a/st.c b/st.c
index e20a1e0..d58af7d 100644
--- a/st.c
+++ b/st.c
_AT_@ -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
Received on Tue Apr 01 2014 - 15:50:10 CEST

This archive was generated by hypermail 2.3.0 : Tue Apr 01 2014 - 16:00:21 CEST