1
0
mirror of https://github.com/moparisthebest/wget synced 2024-07-03 16:38:41 -04:00

[svn] Fix store_hostaddress() on big-endian 64-bit machines.

This commit is contained in:
hniksic 2000-03-31 06:07:07 -08:00
parent dee64b0b16
commit 858adf01cd
2 changed files with 9 additions and 2 deletions

View File

@ -1,3 +1,7 @@
1998-12-01 "R. K. Owen" <rkowen@Nersc.GOV>
* host.c (store_hostaddress): Fix for big endian 64-bit machines.
1998-12-01 Hrvoje Niksic <hniksic@srce.hr>
* url.c (UNSAFE_CHAR): New macro.

View File

@ -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;
}