]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
more: use variable lenght printf field width to print blanks
authorSami Kerola <kerolasa@iki.fi>
Sun, 7 Jul 2013 19:54:49 +0000 (20:54 +0100)
committerKarel Zak <kzak@redhat.com>
Tue, 9 Jul 2013 12:26:10 +0000 (14:26 +0200)
This makes program to run a little faster.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
text-utils/more.c

index 8888a083ba07c46241b7c11ebcbc971d93fa65c5..3bbeede5d97409f0cfb4204332a1875a64d40436 100644 (file)
@@ -1058,8 +1058,7 @@ void erasep(register int col)
                if (!dumb && eraseln)
                        my_putstring(eraseln);
                else
-                       for (col = promptlen - col; col > 0; col--)
-                               putchar(' ');
+                       printf("%*s", promptlen - col, "");
        }
        promptlen = 0;
 }