From: Ralph Corderoy Date: Sun, 23 Oct 2016 22:43:41 +0000 (+0100) Subject: Use HasPrefix() instead of strncmp(). X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/75a98caa3dddfc3276b9506d04a82014bd732e74?hp=648dd5a3eb3c84fdef63b0b1123303741c17ddee Use HasPrefix() instead of strncmp(). --- diff --git a/uip/popsbr.c b/uip/popsbr.c index 54fd24ff..8d2cf9d7 100644 --- a/uip/popsbr.c +++ b/uip/popsbr.c @@ -434,7 +434,7 @@ pop_sasl_callback(enum sasl_message_type mtype, unsigned const char *indata, if (line == NULL) return NOTOK; - if (strncmp(line, "+OK", 3) != 0) { + if (!HasPrefix(line, "+OK")) { 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 (strncmp (buffer, TRM, TRMLEN) == 0) { + if (HasPrefix(buffer, TRM)) { if (buffer[TRMLEN] == 0) return DONE; strncpy (response, buffer + TRMLEN, sizeof(response));