diff --git a/src/ChangeLog b/src/ChangeLog index 663883c8..f522ab61 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +1998-12-01 "R. K. Owen" + + * host.c (store_hostaddress): Fix for big endian 64-bit machines. + 1998-12-01 Hrvoje Niksic * url.c (UNSAFE_CHAR): New macro. diff --git a/src/host.c b/src/host.c index 1b6abf35..03a56fe5 100644 --- a/src/host.c +++ b/src/host.c @@ -145,8 +145,11 @@ store_hostaddress (unsigned char *where, const char *hostname) if ((int)addr != -1) { /* This works on both little and big endian architecture, as - inet_addr returns the address in the proper order. It - appears to work on 64-bit machines too. */ + inet_addr returns the address in the proper order. */ +#ifdef WORDS_BIGENDIAN + if (sizeof (addr) == 8) + addr <<= 32; +#endif memcpy (where, &addr, 4); return 1; }