From 5fa15a19a0917e762c8d10207544f2a0396fd15b Mon Sep 17 00:00:00 2001 From: tyx <462747508@qq.com> Date: Sun, 17 Apr 2022 22:06:13 +0800 Subject: [PATCH] [lwip] Fix compilation warning --- components/net/lwip/lwip-2.0.3/src/apps/ping/ping.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/net/lwip/lwip-2.0.3/src/apps/ping/ping.c b/components/net/lwip/lwip-2.0.3/src/apps/ping/ping.c index 6251504f59..989fb0507a 100644 --- a/components/net/lwip/lwip-2.0.3/src/apps/ping/ping.c +++ b/components/net/lwip/lwip-2.0.3/src/apps/ping/ping.c @@ -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) {