summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornoname@inventati.org2015-04-11 19:30:36 +0200
committerRoberto E. Vargas Caballero2015-04-13 10:18:08 +0200
commitc569e3146e6999f6a02acecd145929c87e15b528 (patch)
tree1918772ec0b0973ba2197f0bd7c543c807db73fe
parent39ae1a4de5c471c8626c80ef1e961f0c83f5199d (diff)
downloadst-c569e3146e6999f6a02acecd145929c87e15b528.tar.gz
st-c569e3146e6999f6a02acecd145929c87e15b528.tar.xz
st-c569e3146e6999f6a02acecd145929c87e15b528.zip
Remove 'slide' variable in tresize.
-rw-r--r--st.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/st.c b/st.c
index 79bf1c8..2c58a3e 100644
--- a/st.c
+++ b/st.c
@@ -2769,7 +2769,6 @@ tresize(int col, int row) {
int i;
int minrow = MIN(row, term.row);
int mincol = MIN(col, term.col);
- int slide = term.c.y - row + 1;
bool *bp;
TCursor c;
@@ -2784,13 +2783,13 @@ tresize(int col, int row) {
* tscrollup would work here, but we can optimize to
* memmove because we're freeing the earlier lines
*/
- for(i = 0; i < slide; i++) {
+ for(i = 0; i <= term.c.y - row; i++) {
free(term.line[i]);
free(term.alt[i]);
}
- if(slide > 0) {
- memmove(term.line, term.line + slide, row * sizeof(Line));
- memmove(term.alt, term.alt + slide, row * sizeof(Line));
+ if(i > 0) {
+ 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]);