From 1fb6287fc4986668e8f49d7c3bdca27d53e267af Mon Sep 17 00:00:00 2001 From: Dmitry Bogatov Date: Fri, 15 Jul 2016 01:39:37 +0300 Subject: [PATCH] simplify whatnow.c/main() function GNU Complexity: 60 -> 59. --- uip/whatnow.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/uip/whatnow.c b/uip/whatnow.c index 65d2fb0..45671ed 100644 --- a/uip/whatnow.c +++ b/uip/whatnow.c @@ -173,10 +173,7 @@ main(int argc, char **argv) } snprintf(prompt, sizeof(prompt), myprompt, invo_name); - for (;;) { - if (!(argp = getans(prompt, aleqs))) { - exit(EX_IOERR); - } + while ((argp = getans(prompt, aleqs))) { switch (smatch(*argp, aleqs)) { case DISPSW: /* display the msg being replied to or distributed */ @@ -381,7 +378,8 @@ main(int argc, char **argv) break; } } - /*NOTREACHED*/ + + exit(EX_IOERR); } -- 1.7.10.4