aboutsummaryrefslogtreecommitdiff
path: root/st.c
diff options
context:
space:
mode:
Diffstat (limited to 'st.c')
-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) {
2769 int i; 2769 int i;
2770 int minrow = MIN(row, term.row); 2770 int minrow = MIN(row, term.row);
2771 int mincol = MIN(col, term.col); 2771 int mincol = MIN(col, term.col);
2772 int slide = term.c.y - row + 1;
2773 bool *bp; 2772 bool *bp;
2774 TCursor c; 2773 TCursor c;
2775 2774
@@ -2784,13 +2783,13 @@ tresize(int col, int row) {
2784 * tscrollup would work here, but we can optimize to 2783 * tscrollup would work here, but we can optimize to
2785 * memmove because we're freeing the earlier lines 2784 * memmove because we're freeing the earlier lines
2786 */ 2785 */
2787 for(i = 0; i < slide; i++) { 2786 for(i = 0; i <= term.c.y - row; i++) {
2788 free(term.line[i]); 2787 free(term.line[i]);
2789 free(term.alt[i]); 2788 free(term.alt[i]);
2790 } 2789 }
2791 if(slide > 0) { 2790 if(i > 0) {
2792 memmove(term.line, term.line + slide, row * sizeof(Line)); 2791 memmove(term.line, term.line + i, row * sizeof(Line));
2793 memmove(term.alt, term.alt + slide, row * sizeof(Line)); 2792 memmove(term.alt, term.alt + i, row * sizeof(Line));
2794 } 2793 }
2795 for(i += row; i < term.row; i++) { 2794 for(i += row; i < term.row; i++) {
2796 free(term.line[i]); 2795 free(term.line[i]);