From 09343b3f096469617b112bbdd24e583b5944ec30 Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Mon, 27 Aug 2007 09:49:54 +0000 Subject: simplify using string_array_length --- mdk-stage1/stdio-frontend.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'mdk-stage1/stdio-frontend.c') diff --git a/mdk-stage1/stdio-frontend.c b/mdk-stage1/stdio-frontend.c index 7d3c6f14b..bf6d5abfc 100644 --- a/mdk-stage1/stdio-frontend.c +++ b/mdk-stage1/stdio-frontend.c @@ -30,7 +30,7 @@ #include #include "frontend.h" - +#include "utils.h" void init_frontend(char * welcome_msg) { @@ -248,18 +248,12 @@ enum return_type ask_from_list_index(char *msg, char ** elems, char ** elems_com snprintf(tmp, sizeof(tmp), "[%%%dd]", justify_number); printf(tmp, i); } - char ** sav_elems = elems; int i = 1; int j = 0; - while (elems && *elems) { - elems++; - i++; - } - if (i >= 10) + if (string_array_length(elems) >= 10) justify_number = 2; - elems = sav_elems; i = 1; printf("> %s\n", msg); -- cgit v1.2.1