X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/55a31c2eec8e219a297ba7fa2f11c3f5108b0fe2..63621a81d16ab743de6b57d47578a9a2c670ad22:/uip/popsbr.c diff --git a/uip/popsbr.c b/uip/popsbr.c index de9cafbd..a9319054 100644 --- a/uip/popsbr.c +++ b/uip/popsbr.c @@ -12,7 +12,7 @@ #include #include -#include "../sbr/base64.h" +#include "sbr/base64.h" #define TRM "." @@ -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 " @@ -277,8 +270,10 @@ pop_init (char *host, char *port, char *user, char *proxy, int snoop, case NOTOK: case DONE: - if (poprint) - fprintf (stderr, "%s\n", response); + if (poprint) { + fputs(response, stderr); + putc('\n', stderr); + } netsec_shutdown(nsc); nsc = NULL; return NOTOK; @@ -603,8 +598,10 @@ vcommand (const char *fmt, va_list ap) case NOTOK: case DONE: - if (poprint) - fprintf (stderr, "%s\n", response); + if (poprint) { + fputs(response, stderr); + putc('\n', stderr); + } return NOTOK; }