]> diplodocus.org Git - nmh/commitdiff
Use HasPrefix() instead of strncmp().
authorRalph Corderoy <ralph@inputplus.co.uk>
Sun, 23 Oct 2016 22:43:41 +0000 (23:43 +0100)
committerRalph Corderoy <ralph@inputplus.co.uk>
Mon, 24 Oct 2016 09:18:56 +0000 (10:18 +0100)
uip/popsbr.c

index 54fd24ffe3515a9d9f885cdbb89a11fb6303e933..8d2cf9d726dafe4ef96ff41c633014b134d77f67 100644 (file)
@@ -434,7 +434,7 @@ pop_sasl_callback(enum sasl_message_type mtype, unsigned const char *indata,
        if (line == NULL)
            return NOTOK;
 
        if (line == NULL)
            return NOTOK;
 
-       if (strncmp(line, "+OK", 3) != 0) {
+       if (!HasPrefix(line, "+OK")) {
            netsec_err(errstr, "Authentication failed: %s", line);
            return NOTOK;
        }
            netsec_err(errstr, "Authentication failed: %s", line);
            return NOTOK;
        }
@@ -690,7 +690,7 @@ multiline (void)
 
     if (pop_getline (buffer, sizeof buffer, nsc) != OK)
        return NOTOK;
 
     if (pop_getline (buffer, sizeof buffer, nsc) != OK)
        return NOTOK;
-    if (strncmp (buffer, TRM, TRMLEN) == 0) {
+    if (HasPrefix(buffer, TRM)) {
        if (buffer[TRMLEN] == 0)
            return DONE;
         strncpy (response, buffer + TRMLEN, sizeof(response));
        if (buffer[TRMLEN] == 0)
            return DONE;
         strncpy (response, buffer + TRMLEN, sizeof(response));