From ab245dddc6a34d6dd2965bf1f74071590c553112 Mon Sep 17 00:00:00 2001 From: Matthias Andree Date: Sun, 12 May 2019 10:08:35 +0200 Subject: Replace most strncpy() by strlcpy() calls. --- smtp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'smtp.c') diff --git a/smtp.c b/smtp.c index e6af901b..9ca93813 100644 --- a/smtp.c +++ b/smtp.c @@ -204,8 +204,7 @@ int SMTP_ehlo(int sock, char smtp_mode, const char *host, char *name, char *pass if (!strncasecmp(hp->name, smtp_response+4, strlen(hp->name))) { *opt |= hp->value; if (strncmp(hp->name, "AUTH ", 5) == 0) - strncpy(auth_response, smtp_response, sizeof(auth_response)); - auth_response[sizeof(auth_response)-1] = '\0'; + strlcpy(auth_response, smtp_response, sizeof(auth_response)); } if ((smtp_response[0] == '1' || smtp_response[0] == '2' || smtp_response[0] == '3') && smtp_response[3] == ' ') { if (*opt & ESMTP_AUTH) -- cgit v1.2.3