From 75a98caa3dddfc3276b9506d04a82014bd732e74 Mon Sep 17 00:00:00 2001 From: Ralph Corderoy Date: Sun, 23 Oct 2016 23:43:41 +0100 Subject: [PATCH] Use HasPrefix() instead of strncmp(). --- uip/popsbr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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)); -- 2.56.0