[PATCH v3 1/3] console_countdown: width to of countdown to 4 digits

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx>

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@xxxxxxxxxxxxxx>
Signed-off-by: Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx>
---
 common/console_countdown.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/common/console_countdown.c b/common/console_countdown.c
index c0c8c9502..b2eec72b2 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));
-- 
2.11.0


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux