multiprogress.c (clear_progress): Write the `n - 1' loops in a better way.
authorMark Wooding <mdw@distorted.org.uk>
Fri, 25 Mar 2022 01:19:01 +0000 (01:19 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Fri, 25 Mar 2022 18:51:48 +0000 (18:51 +0000)
multiprogress.c

index b4d1193..4d4ae3e 100644 (file)
@@ -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);
     }