From: Rafa Garcia Gallego Date: Wed, 26 Mar 2014 22:58:27 +0000 (+0100) Subject: Fix segfault when pressing PrintScr without a selection X-Git-Url: https://git.danieliu.xyz/?a=commitdiff_plain;h=672e4e4b03d8987103020d399b2c05c95a9ea2f8;p=st.git 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 @@ -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