summaryrefslogtreecommitdiffstats
path: root/common/console_countdown.c
diff options
context:
space:
mode:
authorMarc Kleine-Budde <mkl@pengutronix.de>2017-03-10 07:05:21 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2017-03-10 08:43:26 +0100
commit3d92ea473884cddad18ab6f0554492f4468bc25f (patch)
tree593bf3a3d04a324dc90fe672048ffe8549535284 /common/console_countdown.c
parentdfcfb5b831e4e229ec84163a9757250b709274ee (diff)
downloadbarebox-3d92ea473884cddad18ab6f0554492f4468bc25f.tar.gz
barebox-3d92ea473884cddad18ab6f0554492f4468bc25f.tar.xz
console_countdown: width to of countdown to 4 digits
This patch increases the displayed width of the countdown to 4 digits, otherwise waiting for more then 99 seconds doesn't look good. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common/console_countdown.c')
-rw-r--r--common/console_countdown.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/common/console_countdown.c b/common/console_countdown.c
index c0c8c95022..b2eec72b24 100644
--- a/common/console_countdown.c
+++ b/common/console_countdown.c
@@ -35,7 +35,7 @@ int console_countdown(int timeout_s, unsigned flags, char *out_key)
countdown = timeout_s;
if (!(flags & CONSOLE_COUNTDOWN_SILENT))
- printf("%2d", countdown--);
+ printf("%4d", countdown--);
do {
if (tstc()) {
@@ -50,7 +50,7 @@ int console_countdown(int timeout_s, unsigned flags, char *out_key)
}
if (!(flags & CONSOLE_COUNTDOWN_SILENT) &&
is_timeout(second, SECOND)) {
- printf("\b\b%2d", countdown--);
+ printf("\b\b\b\b%4d", countdown--);
second += SECOND;
}
} while (!is_timeout(start, timeout_s * SECOND));