[lwip] Fix compilation warning

This commit is contained in:
tyx 2022-04-17 22:06:13 +08:00 committed by guo
parent a6135ebcf3
commit 5fa15a19a0
1 changed files with 3 additions and 3 deletions

View File

@ -157,15 +157,15 @@ rt_err_t ping(char* target_name, rt_uint32_t times, rt_size_t size)
size = PING_DATA_SIZE;
}
memset(&hint, 0, sizeof(hint));
rt_memset(&hint, 0, sizeof(hint));
/* convert URL to IP */
if (lwip_getaddrinfo(target_name, NULL, &hint, &res) != 0)
{
rt_kprintf("ping: unknown host %s\n", target_name);
return -RT_ERROR;
}
memcpy(&h, &res->ai_addr, sizeof(struct sockaddr_in *));
memcpy(&ina, &h->sin_addr, sizeof(ina));
rt_memcpy(&h, &res->ai_addr, sizeof(struct sockaddr_in *));
rt_memcpy(&ina, &h->sin_addr, sizeof(ina));
lwip_freeaddrinfo(res);
if (inet_aton(inet_ntoa(ina), &target_addr) == 0)
{