fix DNS issue caused by HTON macro weirdness on 32bits + fix inet_aton()

This commit is contained in:
Martin Ayotte 2015-07-03 23:04:22 -04:00
parent cfa28a9a75
commit 25e81d7cf1
2 changed files with 2 additions and 3 deletions

View File

@ -58,8 +58,7 @@ int DNSClient::inet_aton(const char* aIPAddrString, IPAddress& aResult)
{
// See if we've been given a valid IP address
const char* p =aIPAddrString;
while (*p &&
( (*p == '.') || (*p >= '0') || (*p <= '9') ))
while (*p && ( (*p == '.') || ((*p >= '0') && (*p <= '9')) ))
{
p++;
}

View File

@ -1,7 +1,7 @@
#ifndef UTIL_H
#define UTIL_H
#define htons(x) ( ((x)<<8) | (((x)>>8)&0xFF) )
#define htons(x) ( ((x)<< 8 & 0xFF00) | ((x)>> 8 & 0x00FF) )
#define ntohs(x) htons(x)
#define htonl(x) ( ((x)<<24 & 0xFF000000UL) | \