Re: [dev] [st] [PATCH 3/3] Remove 'slide' variable in tresize.

From: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
Date: Mon, 13 Apr 2015 10:19:23 +0200

Applied, thanks.

attached mail follows:



---
 st.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/st.c b/st.c
index 51bd40c..ce2646e 100644
--- a/st.c
+++ b/st.c
_AT_@ -2770,7 +2770,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;
 
_AT_@ -2785,13 +2784,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]);
-- 
1.8.4
Received on Mon Apr 13 2015 - 10:19:23 CEST

This archive was generated by hypermail 2.3.0 : Mon Apr 13 2015 - 10:24:07 CEST