tFix segfault when pressing PrintScr without a selection - st - [fork] customiz… | |
git clone git://src.adamsgaard.dk/st | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit 672e4e4b03d8987103020d399b2c05c95a9ea2f8 | |
parent 45b808b88ee63f21a188800ba3473a24a3c4b987 | |
Author: Rafa Garcia Gallego <[email protected]> | |
Date: Wed, 26 Mar 2014 23:58:27 +0100 | |
Fix segfault when pressing PrintScr without a selection | |
Diffstat: | |
M st.c | 7 ++++--- | |
1 file changed, 4 insertions(+), 3 deletions(-) | |
--- | |
diff --git a/st.c b/st.c | |
t@@ -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 |