diff --git a/src/apps/smtp/smtp.c b/src/apps/smtp/smtp.c index aa8380d6..2aa21ce0 100644 --- a/src/apps/smtp/smtp.c +++ b/src/apps/smtp/smtp.c @@ -65,7 +65,7 @@ #include "lwip/altcp_tcp.h" #include "lwip/altcp_tls.h" -#include /* strnlen, memcpy */ +#include /* strlen, memcpy */ #include /** TCP poll interval. Unit is 0.5 sec. */ @@ -353,9 +353,8 @@ smtp_set_server_addr(const char* server) LWIP_ASSERT_CORE_LOCKED(); if (server != NULL) { - /* strnlen: returns length WITHOUT terminating 0 byte OR - * SMTP_MAX_SERVERNAME_LEN+1 when string is too long */ - len = strnlen(server, SMTP_MAX_SERVERNAME_LEN+1); + /* strlen: returns length WITHOUT terminating 0 byte */ + len = strlen(server); } if (len > SMTP_MAX_SERVERNAME_LEN) { return ERR_MEM;