X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=st.c;h=2a565b6e96e7d1c3692a2dd5ed18331981a24b37;hb=9619760e129b0994cd3bc4c827c83960f6a5e98f;hp=4f5cf9ed78cc93be6e1be821ed5ae2604c4dc7f6;hpb=e6dd0f825da9bf68c7642f45afd069500879f5e2;p=st.git diff --git a/st.c b/st.c index 4f5cf9e..2a565b6 100644 --- a/st.c +++ b/st.c @@ -2783,10 +2783,8 @@ tresize(int col, int row) { free(term.line[i]); free(term.alt[i]); } - if(i > 0) { - memmove(term.line, term.line + i, row * sizeof(Line)); - memmove(term.alt, term.alt + i, row * sizeof(Line)); - } + memmove(term.line, term.line + i, row * sizeof(Line)); + memmove(term.alt, term.alt + i, row * sizeof(Line)); for(i += row; i < term.row; i++) { free(term.line[i]); free(term.alt[i]); @@ -4010,7 +4008,6 @@ usage(void) { int main(int argc, char *argv[]) { - char *titles; uint cols = 80, rows = 24; xw.l = xw.t = 0; @@ -4028,10 +4025,8 @@ main(int argc, char *argv[]) { /* eat all remaining arguments */ if(argc > 1) { opt_cmd = &argv[1]; - if(argv[1] != NULL && opt_title == NULL) { - titles = xstrdup(argv[1]); - opt_title = basename(titles); - } + if(argv[1] != NULL && opt_title == NULL) + opt_title = basename(xstrdup(argv[1])); } goto run; case 'f':