From: Dmitry Bogatov Date: Thu, 14 Jul 2016 22:39:37 +0000 (+0300) Subject: simplify whatnow.c/main() function X-Git-Tag: mmh-0.3~27 X-Git-Url: http://git.marmaro.de/?p=mmh;a=commitdiff_plain;h=1fb6287fc4986668e8f49d7c3bdca27d53e267af;hp=49f93810142f22bc3bc86a9ccbe96f1f56b578ac simplify whatnow.c/main() function GNU Complexity: 60 -> 59. --- 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); }