mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-12-25 18:14:53 +00:00
mdns: fix implicit cast warnings (size_t to u8_t)
This commit is contained in:
parent
814341a6ed
commit
4506db4331
@ -2146,7 +2146,7 @@ err_t
|
|||||||
mdns_resp_rename_netif(struct netif *netif, const char *hostname)
|
mdns_resp_rename_netif(struct netif *netif, const char *hostname)
|
||||||
{
|
{
|
||||||
struct mdns_host *mdns;
|
struct mdns_host *mdns;
|
||||||
u8_t len;
|
size_t len;
|
||||||
|
|
||||||
LWIP_ASSERT_CORE_LOCKED();
|
LWIP_ASSERT_CORE_LOCKED();
|
||||||
len = strlen(hostname);
|
len = strlen(hostname);
|
||||||
@ -2155,7 +2155,7 @@ mdns_resp_rename_netif(struct netif *netif, const char *hostname)
|
|||||||
mdns = NETIF_TO_HOST(netif);
|
mdns = NETIF_TO_HOST(netif);
|
||||||
LWIP_ERROR("mdns_resp_rename_netif: Not an mdns netif", (mdns != NULL), return ERR_VAL);
|
LWIP_ERROR("mdns_resp_rename_netif: Not an mdns netif", (mdns != NULL), return ERR_VAL);
|
||||||
|
|
||||||
MEMCPY(&mdns->name, hostname, len);
|
MEMCPY(&mdns->name, hostname, LWIP_MIN(MDNS_LABEL_MAXLEN, len));
|
||||||
mdns->name[len] = '\0'; /* null termination in case new name is shorter than previous */
|
mdns->name[len] = '\0'; /* null termination in case new name is shorter than previous */
|
||||||
|
|
||||||
mdns_resp_restart(netif);
|
mdns_resp_restart(netif);
|
||||||
@ -2258,7 +2258,7 @@ mdns_resp_rename_service(struct netif *netif, s8_t slot, const char *name)
|
|||||||
{
|
{
|
||||||
struct mdns_service *srv;
|
struct mdns_service *srv;
|
||||||
struct mdns_host *mdns;
|
struct mdns_host *mdns;
|
||||||
u8_t len;
|
size_t len;
|
||||||
|
|
||||||
LWIP_ASSERT_CORE_LOCKED();
|
LWIP_ASSERT_CORE_LOCKED();
|
||||||
len = strlen(name);
|
len = strlen(name);
|
||||||
@ -2271,7 +2271,7 @@ mdns_resp_rename_service(struct netif *netif, s8_t slot, const char *name)
|
|||||||
|
|
||||||
srv = mdns->services[slot];
|
srv = mdns->services[slot];
|
||||||
|
|
||||||
MEMCPY(&srv->name, name, len);
|
MEMCPY(&srv->name, name, LWIP_MIN(MDNS_LABEL_MAXLEN, len));
|
||||||
srv->name[len] = '\0'; /* null termination in case new name is shorter than previous */
|
srv->name[len] = '\0'; /* null termination in case new name is shorter than previous */
|
||||||
|
|
||||||
mdns_resp_restart(netif);
|
mdns_resp_restart(netif);
|
||||||
|
Loading…
Reference in New Issue
Block a user