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:
parent
dee64b0b16
commit
858adf01cd
@ -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>
|
1998-12-01 Hrvoje Niksic <hniksic@srce.hr>
|
||||||
|
|
||||||
* url.c (UNSAFE_CHAR): New macro.
|
* url.c (UNSAFE_CHAR): New macro.
|
||||||
|
@ -145,8 +145,11 @@ store_hostaddress (unsigned char *where, const char *hostname)
|
|||||||
if ((int)addr != -1)
|
if ((int)addr != -1)
|
||||||
{
|
{
|
||||||
/* This works on both little and big endian architecture, as
|
/* This works on both little and big endian architecture, as
|
||||||
inet_addr returns the address in the proper order. It
|
inet_addr returns the address in the proper order. */
|
||||||
appears to work on 64-bit machines too. */
|
#ifdef WORDS_BIGENDIAN
|
||||||
|
if (sizeof (addr) == 8)
|
||||||
|
addr <<= 32;
|
||||||
|
#endif
|
||||||
memcpy (where, &addr, 4);
|
memcpy (where, &addr, 4);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user