COMP: Remove alignment warning
This commit is contained in:
parent
031e956adc
commit
37c5553818
@ -59,7 +59,13 @@ static const char *inet_ntop4 (const u_char *src, char *dst, size_t size)
|
|||||||
#ifdef HAVE_INET_NTOA_R
|
#ifdef HAVE_INET_NTOA_R
|
||||||
return inet_ntoa_r(*(struct in_addr*)src, dst, size);
|
return inet_ntoa_r(*(struct in_addr*)src, dst, size);
|
||||||
#else
|
#else
|
||||||
const char *addr = inet_ntoa(*(struct in_addr*)src);
|
union {
|
||||||
|
const u_char* uch;
|
||||||
|
const struct in_addr* iad;
|
||||||
|
} srcaddr;
|
||||||
|
const char *addr;
|
||||||
|
srcaddr.uch = src;
|
||||||
|
addr = inet_ntoa(*srcaddr.iad);
|
||||||
|
|
||||||
if (strlen(addr) >= size)
|
if (strlen(addr) >= size)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user