[PATCH 1/3] menu: Align entries

Sascha Hauer s.hauer at pengutronix.de
Wed Jun 19 16:53:40 EDT 2013


More than 9 menu entries in are single menu are not aligned anymore, like
this:

8 entry8
9 entry9
10 entry10

Use %2d in the printf format specifier to align more than 9 entries.

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 common/menu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/menu.c b/common/menu.c
index a672e59..1f0ffec 100644
--- a/common/menu.c
+++ b/common/menu.c
@@ -175,7 +175,7 @@ static void print_menu_entry(struct menu *m, struct menu_entry *me,
 		puts("   ");
 	}
 
-	printf(" %d: ", me->num);
+	printf(" %2d: ", me->num);
 	if (selected)
 		puts("\e[7m");
 
-- 
1.8.3.1




More information about the barebox mailing list