Remove smtp_server when passing NULL to smtp_set_server_addr() (see patch #9373 for discussion)

This commit is contained in:
goldsimon 2017-06-13 22:00:48 +02:00
parent 117d3abdf8
commit bab7a32eec

View File

@ -351,7 +351,11 @@ smtp_set_server_addr(const char* server)
if (len > SMTP_MAX_SERVERNAME_LEN) {
return ERR_MEM;
}
MEMCPY(smtp_server, server, len);
if (len != 0) {
MEMCPY(smtp_server, server, len);
} else {
smtp_server[0] = 0;
}
return ERR_OK;
}