Fix compilation errors when using gcc-7.2.0 for the crosstool-ng toolchain

* Change snprintf for strlcat does not complain w/gcc7.2.0 and it is safer, thanks @projectgus
* Use proper quotes for character literals

Merges https://github.com/espressif/esp-idf/pull/1163


* Original commit: espressif/esp-idf@519edc332d
This commit is contained in:
Roman Valls Guimera
2017-10-25 23:23:42 +02:00
committed by suren-gabrielyan-espressif
parent 00a72b8920
commit 3aa605fe24

View File

@ -569,7 +569,8 @@ static const uint8_t * _mdns_read_fqdn(const uint8_t * packet, const uint8_t * s
&& (strcmp(buf, MDNS_DEFAULT_DOMAIN) != 0)
&& (strcmp(buf, "ip6") != 0)
&& (strcmp(buf, "in-addr") != 0)) {
snprintf((char*)name, MDNS_NAME_BUF_LEN, "%s.%s", name->host, buf);
strlcat(name->host, ".", sizeof(name->host));
strlcat(name->host, buf, sizeof(name->host));
} else if (strcmp(buf, MDNS_SUB_STR) == 0) {
name->sub = 1;
} else {