]> diplodocus.org Git - nmh/commitdiff
Don't `else' after return. Simplify control flow.
authorRalph Corderoy <ralph@inputplus.co.uk>
Thu, 20 Oct 2016 22:57:56 +0000 (23:57 +0100)
committerRalph Corderoy <ralph@inputplus.co.uk>
Thu, 20 Oct 2016 22:57:56 +0000 (23:57 +0100)
uip/popsbr.c

index 50cdf09b12c79bc546f4e3470cad3fc4a72727f2..fa9b99d1e542dcddc208350b7d184feb4d538758 100644 (file)
@@ -252,21 +252,20 @@ pop_init (char *host, char *port, char *user, char *proxy, int snoop,
                        return NOTOK;
                    }
                    return OK;
                        return NOTOK;
                    }
                    return OK;
-               } else {
-                   nmh_creds_t creds;
-
-                   if (!(creds = nmh_get_credentials(host, user)))
-                       return NOTOK;
-                   if (command ("USER %s", nmh_cred_get_user(creds))
-                                                               != NOTOK) {
-                       if (command("PASS %s", nmh_cred_get_password(creds))
-                                                               != NOTOK) {
-                           nmh_credentials_free(creds);
-                           return OK;
-                       }
-                   }
-                   nmh_credentials_free(creds);
                }
                }
+                nmh_creds_t creds;
+
+                if (!(creds = nmh_get_credentials(host, user)))
+                    return NOTOK;
+                if (command ("USER %s", nmh_cred_get_user(creds))
+                                                            != NOTOK) {
+                    if (command("PASS %s", nmh_cred_get_password(creds))
+                                                            != NOTOK) {
+                        nmh_credentials_free(creds);
+                        return OK;
+                    }
+                }
+                nmh_credentials_free(creds);
            }
            strncpy (buffer, response, sizeof(buffer));
            command ("QUIT");
            }
            strncpy (buffer, response, sizeof(buffer));
            command ("QUIT");
@@ -693,8 +692,7 @@ multiline (void)
     if (strncmp (buffer, TRM, TRMLEN) == 0) {
        if (buffer[TRMLEN] == 0)
            return DONE;
     if (strncmp (buffer, TRM, TRMLEN) == 0) {
        if (buffer[TRMLEN] == 0)
            return DONE;
-       else
-           strncpy (response, buffer + TRMLEN, sizeof(response));
+        strncpy (response, buffer + TRMLEN, sizeof(response));
     }
     else
        strncpy (response, buffer, sizeof(response));
     }
     else
        strncpy (response, buffer, sizeof(response));