]> diplodocus.org Git - nmh/blobdiff - mts/smtp/smtp.c
man: Fix spelling mistakes.
[nmh] / mts / smtp / smtp.c
index 7b706e010e8e7926d969a69af5c31abda26f9544..fdc56b06ab921fb41d49ff3dc3cd0c59e6a06403 100644 (file)
@@ -295,14 +295,13 @@ sendmail_init (char *client, int watch, int verbose, int debug, int sasl,
            client = clientname;
        else
            client = LocalName(1);      /* no clientname -> LocalName */
-    }
 
-    /*
-     * Last-ditch check just in case client still isn't set to anything
-     */
-
-    if (client == NULL || *client == '\0')
-       client = "localhost";
+        /*
+         * Last-ditch check just in case client still isn't set to anything
+         */
+        if (client == NULL || *client == '\0')
+            client = "localhost";
+    }
 
     nsc = netsec_init();
 
@@ -812,7 +811,7 @@ again: ;
                                                 &errstr)) != NULL ; ) {
 
        if (doingEHLO
-               && strncmp (buffer, "250", LEN("250")) == 0
+               && HasPrefix(buffer, "250")
                && (buffer[3] == '-' || doingEHLO == 2)
                && buffer[4]) {
            if (doingEHLO == 2) {
@@ -874,7 +873,7 @@ again: ;
            continue;
        if (sm_reply.code < 100) {
            if (sm_verbose) {
-               printf ("%s\n", sm_reply.text);
+               puts(sm_reply.text);
                fflush (stdout);
            }
            goto again;
@@ -951,7 +950,7 @@ EHLOset (char *s)
 
     for (ehlo = EHLOkeys; *ehlo; ehlo++) {
        ep = *ehlo;
-       if (strncmp (ep, s, len) == 0) {
+       if (HasPrefix(ep, s)) {
            for (ep += len; *ep == ' '; ep++)
                continue;
            return ep;
@@ -1029,7 +1028,7 @@ sm_sasl_callback(enum sasl_message_type mtype, unsigned const char *indata,
            return NOTOK;
        }
 
-       if (strncmp(line, "334 ", 4) != 0) {
+       if (!HasPrefix(line, "334 ")) {
            netsec_err(errstr, "Improper SASL protocol response: %s", line);
            return NOTOK;
        }
@@ -1078,7 +1077,7 @@ sm_sasl_callback(enum sasl_message_type mtype, unsigned const char *indata,
        if (line == NULL)
            return NOTOK;
 
-       if (strncmp(line, "235 ", 4) != 0) {
+       if (!HasPrefix(line, "235 ")) {
            if (len > 4)
                netsec_err(errstr, "Authentication failed: %s", line + 4);
            else