X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=st.c;h=b042be2039b8ddc3a4121e09f23c865c89581fba;hb=742a41d6554ce1848f45ea89cb83d62c7e881352;hp=0204b2e14d1d561f0bdfbf3e0007bdeec03de37f;hpb=89807ed453e27893dea5ac73ee2c6b4f8dd15afb;p=st.git diff --git a/st.c b/st.c index 0204b2e..b042be2 100644 --- a/st.c +++ b/st.c @@ -1276,7 +1276,8 @@ stty(void) siz-= n + 1; } *q = '\0'; - system(cmd); + if (system(cmd) != 0) + perror("Couldn't call stty"); } void @@ -2268,8 +2269,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 */ @@ -2927,7 +2927,7 @@ xloadcols(void) { Color *cp; if(loaded) { - for (cp = dc.col; cp < dc.col + LEN(dc.col); ++cp) + for (cp = dc.col; cp < &dc.col[LEN(dc.col)]; ++cp) XftColorFree(xw.dpy, xw.vis, xw.cmap, cp); } @@ -4066,7 +4066,7 @@ run: if(argc > 0) { /* eat all remaining arguments */ opt_cmd = argv; - if(!opt_title) + if(!opt_title && !opt_line) opt_title = basename(xstrdup(argv[0])); } setlocale(LC_CTYPE, "");