apps/smtp: Ensure smtp_server is NULL terminated

Ensure we set correct setting when changing smtp_server setting.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
This commit is contained in:
Axel Lin 2017-06-14 04:16:07 +08:00 committed by Dirk Ziegelmeier
parent d5cdb91611
commit 4af438916a

View File

@ -353,9 +353,8 @@ smtp_set_server_addr(const char* server)
} }
if (len != 0) { if (len != 0) {
MEMCPY(smtp_server, server, len); MEMCPY(smtp_server, server, len);
} else {
smtp_server[0] = 0;
} }
smtp_server[len] = 0;
return ERR_OK; return ERR_OK;
} }