From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cm1W0-0008Jk-0p for barebox@lists.infradead.org; Thu, 09 Mar 2017 17:06:16 +0000 From: Oleksij Rempel Date: Thu, 9 Mar 2017 18:05:43 +0100 Message-Id: <20170309170545.25325-1-o.rempel@pengutronix.de> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH 1/3] console_countdown: width to of countdown to 4 digits To: barebox@lists.infradead.org From: Marc Kleine-Budde 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 --- 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@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox