aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafa Garcia Gallego <rafael.garcia.gallego@gmail.com>2014-03-26 23:58:27 +0100
committerRoberto E. Vargas Caballero <k0ga@shike2.com>2014-03-27 07:48:32 +0100
commit672e4e4b03d8987103020d399b2c05c95a9ea2f8 (patch)
tree3d03062150d1fab72179dfb7941290b951c974c5
parent45b808b88ee63f21a188800ba3473a24a3c4b987 (diff)
downloadst-672e4e4b03d8987103020d399b2c05c95a9ea2f8.tar.gz
st-672e4e4b03d8987103020d399b2c05c95a9ea2f8.tar.bz2
st-672e4e4b03d8987103020d399b2c05c95a9ea2f8.zip
Fix segfault when pressing PrintScr without a selection
-rw-r--r--st.c7
1 files changed, 4 insertions, 3 deletions
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