From d0f0b99662037f1d87d23c8742358768ac319906 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Fri, 25 Mar 2022 01:19:01 +0000 Subject: [PATCH] multiprogress.c (clear_progress): Write the `n - 1' loops in a better way. --- multiprogress.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/multiprogress.c b/multiprogress.c index b4d1193..4d4ae3e 100644 --- a/multiprogress.c +++ b/multiprogress.c @@ -427,9 +427,9 @@ static int clear_progress(struct progress_state *progress, nleave = progress->last_lines - ndel; } if (!ndel) - for (i = 0; i < nleave - 1; i++) put_sequence(tty, tty->cap.up, 1); + for (i = 1; i < nleave; i++) put_sequence(tty, tty->cap.up, 1); else { - for (i = 0; i < ndel - 1; i++) put_sequence(tty, tty->cap.up, 1); + for (i = 1; i < ndel; i++) put_sequence(tty, tty->cap.up, 1); put_sequence(tty, tty->cap.cd, ndel); for (i = 0; i < nleave; i++) put_sequence(tty, tty->cap.up, 1); } -- 2.11.0