tFix segmentation fault in strhandle() - st - [fork] customized build of st, th… | |
git clone git://src.adamsgaard.dk/st | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit 0d7448dabc981716d277a5afac22fabc127bacca | |
parent b17aa18f7c15be8db2afd62ac696b63c75755f1c | |
Author: Roberto E. Vargas Caballero <[email protected]> | |
Date: Thu, 23 Apr 2015 17:55:41 +0200 | |
Fix segmentation fault in strhandle() | |
We cannot pass strescseq.args[0] to atoi when nargs is zero, | |
because in this case it will be null. | |
Diffstat: | |
M st.c | 3 +-- | |
1 file changed, 1 insertion(+), 2 deletions(-) | |
--- | |
diff --git a/st.c b/st.c | |
t@@ -2268,8 +2268,7 @@ strhandle(void) { | |
term.esc &= ~(ESC_STR_END|ESC_STR); | |
strparse(); | |
- narg = strescseq.narg; | |
- par = atoi(strescseq.args[0]); | |
+ par = (narg = strescseq.narg) ? atoi(strescseq.args[0]) : 0; | |
switch(strescseq.type) { | |
case ']': /* OSC -- Operating System Command */ |