diff options
author | Olivier Blin <oblin@mandriva.com> | 2007-08-27 09:49:54 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.com> | 2007-08-27 09:49:54 +0000 |
commit | 09343b3f096469617b112bbdd24e583b5944ec30 (patch) | |
tree | e8bc99ba97cf9897bb5f7a8cf7d901e73662a32f /mdk-stage1 | |
parent | 91b3cff7370ce5ebac761c40c8c41a35345a51b0 (diff) | |
download | drakx-09343b3f096469617b112bbdd24e583b5944ec30.tar drakx-09343b3f096469617b112bbdd24e583b5944ec30.tar.gz drakx-09343b3f096469617b112bbdd24e583b5944ec30.tar.bz2 drakx-09343b3f096469617b112bbdd24e583b5944ec30.tar.xz drakx-09343b3f096469617b112bbdd24e583b5944ec30.zip |
simplify using string_array_length
Diffstat (limited to 'mdk-stage1')
-rw-r--r-- | mdk-stage1/stdio-frontend.c | 10 |
1 files changed, 2 insertions, 8 deletions
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 <probing.h> #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); |