From 1be45208ddf9d53398486ba1bce54d43ec026705 Mon Sep 17 00:00:00 2001 From: Ralph Corderoy Date: Fri, 8 Sep 2017 14:49:21 +0100 Subject: [PATCH] popsbr.c: Remove impossible case from switch statement. Actually, just convert the overkill switch statement into a couple of if-statements as it's a lot less lines. --- uip/popsbr.c | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/uip/popsbr.c b/uip/popsbr.c index de9cafbd..c5af09dd 100644 --- a/uip/popsbr.c +++ b/uip/popsbr.c @@ -56,23 +56,16 @@ check_mech(char *server_mechs, size_t server_mechs_size) return NOTOK; } - while ((status = multiline()) != DONE) - switch (status) { - case NOTOK: + while ((status = multiline()) != DONE) { + if (status == NOTOK) return NOTOK; - break; - case DONE: /* Shouldn't be possible, but just in case */ - break; - case OK: - if (strncasecmp(response, "SASL ", 5) == 0) { - /* - * We've seen the SASL capability. Grab the mech list - */ - sasl_capability++; - strncpy(server_mechs, response + 5, server_mechs_size); - } - break; - } + + if (strncasecmp(response, "SASL ", 5) == 0) { + /* We've seen the SASL capability. Grab the mech list. */ + sasl_capability++; + strncpy(server_mechs, response + 5, server_mechs_size); + } + } if (!sasl_capability) { snprintf(response, sizeof(response), "POP server does not support " -- 2.56.0