mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-01 03:34:32 +02:00
Minor fixes
This commit is contained in:
committed by
Jitin George
parent
adbcaf8938
commit
eb051fe72f
@@ -26,12 +26,10 @@ static struct addrinfo *resolve_host_name(const char *host, size_t hostlen)
|
||||
hints.ai_family = AF_UNSPEC;
|
||||
hints.ai_socktype = SOCK_STREAM;
|
||||
|
||||
char *use_host = (char *)calloc(1, hostlen + 1);
|
||||
char *use_host = strndup(host, hostlen);
|
||||
if (!use_host) {
|
||||
return NULL;
|
||||
}
|
||||
strncpy(use_host, host, hostlen);
|
||||
use_host[hostlen] = '\0';
|
||||
|
||||
ESP_LOGD(TAG, "host:%s: strlen %zu\n", use_host, hostlen);
|
||||
struct addrinfo *res;
|
||||
|
Reference in New Issue
Block a user