summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--screen.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/screen.c b/screen.c
index 5b2adc6..a124a3f 100644
--- a/screen.c
+++ b/screen.c
@@ -476,7 +476,8 @@ void crop_to_rect(int x1, int y1, int x2, int y2){
for (i=0; i<= y2-y1; i ++){
ensure_line_length(&(screen.l[i]), screen.l[i+y1].lst+1);
sprintf(screen.l[i].s, "%s", screen.l[i+y1].s + x1);
- screen.l[i].lst = screen.l[i+y1].lst - x1;
+ screen.l[i].lst = x2 - x1;
+ screen.l[i].s[screen.l[i].lst + 1] = '\0';
}
while (i< HEIGHT){
screen.l[i].lst = -1;