Skip to content

Commit 3aa605f

Browse files
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 espressif/esp-idf#1163 * Original commit: espressif/esp-idf@519edc3
1 parent 00a72b8 commit 3aa605f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

components/mdns/mdns.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,8 @@ static const uint8_t * _mdns_read_fqdn(const uint8_t * packet, const uint8_t * s
569569
&& (strcmp(buf, MDNS_DEFAULT_DOMAIN) != 0)
570570
&& (strcmp(buf, "ip6") != 0)
571571
&& (strcmp(buf, "in-addr") != 0)) {
572-
snprintf((char*)name, MDNS_NAME_BUF_LEN, "%s.%s", name->host, buf);
572+
strlcat(name->host, ".", sizeof(name->host));
573+
strlcat(name->host, buf, sizeof(name->host));
573574
} else if (strcmp(buf, MDNS_SUB_STR) == 0) {
574575
name->sub = 1;
575576
} else {

0 commit comments

Comments
 (0)