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
This commit is contained in:
parent
a4d45a0a4d
commit
36d6e4e2c7
3 changed files with 5 additions and 4 deletions
|
@ -270,7 +270,7 @@ extern char *suboptarg; /* getsubopt(3) external variable */
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
static const char rcsid[]="$Id: getopt_long.c,v 1.1 2009/10/16 19:50:28 rodney Exp rodney $";
|
//static const char rcsid[]="$Id: getopt_long.c,v 1.1 2009/10/16 19:50:28 rodney Exp rodney $";
|
||||||
#endif /* lint */
|
#endif /* lint */
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2000 The NetBSD Foundation, Inc.
|
* Copyright (c) 2000 The NetBSD Foundation, Inc.
|
||||||
|
|
|
@ -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, MDNS_DEFAULT_DOMAIN) != 0)
|
||||||
&& (strcmp(buf, "ip6") != 0)
|
&& (strcmp(buf, "ip6") != 0)
|
||||||
&& (strcmp(buf, "in-addr") != 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) {
|
} else if (strcmp(buf, MDNS_SUB_STR) == 0) {
|
||||||
name->sub = 1;
|
name->sub = 1;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -62,7 +62,7 @@ void HashList::insert(const Item& item, size_t index)
|
||||||
|
|
||||||
void HashList::erase(size_t index)
|
void HashList::erase(size_t index)
|
||||||
{
|
{
|
||||||
for (auto it = std::begin(mBlockList); it != std::end(mBlockList);) {
|
for (auto it = mBlockList.begin(); it != mBlockList.end();) {
|
||||||
bool haveEntries = false;
|
bool haveEntries = false;
|
||||||
for (size_t i = 0; i < it->mCount; ++i) {
|
for (size_t i = 0; i < it->mCount; ++i) {
|
||||||
if (it->mNodes[i].mIndex == index) {
|
if (it->mNodes[i].mIndex == index) {
|
||||||
|
@ -88,7 +88,7 @@ void HashList::erase(size_t index)
|
||||||
size_t HashList::find(size_t start, const Item& item)
|
size_t HashList::find(size_t start, const Item& item)
|
||||||
{
|
{
|
||||||
const uint32_t hash_24 = item.calculateCrc32WithoutValue() & 0xffffff;
|
const uint32_t hash_24 = item.calculateCrc32WithoutValue() & 0xffffff;
|
||||||
for (auto it = std::begin(mBlockList); it != std::end(mBlockList); ++it) {
|
for (auto it = mBlockList.begin(); it != mBlockList.end(); ++it) {
|
||||||
for (size_t index = 0; index < it->mCount; ++index) {
|
for (size_t index = 0; index < it->mCount; ++index) {
|
||||||
HashListNode& e = it->mNodes[index];
|
HashListNode& e = it->mNodes[index];
|
||||||
if (e.mIndex >= start &&
|
if (e.mIndex >= start &&
|
||||||
|
|
Loading…
Reference in a new issue