]> sjero.net Git - wget/commitdiff
[svn] Fix store_hostaddress() on big-endian 64-bit machines.
authorhniksic <devnull@localhost>
Fri, 31 Mar 2000 14:07:07 +0000 (06:07 -0800)
committerhniksic <devnull@localhost>
Fri, 31 Mar 2000 14:07:07 +0000 (06:07 -0800)
src/ChangeLog
src/host.c

index 663883c8c7a037bc36b21f099657ee04bf96e378..f522ab61d623956e512fc6ee056662c9b4374372 100644 (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.
index 1b6abf35a1baeb77371b29cf68fda88b5e8f46a9..03a56fe57cd07a46dee12da1b352363d0e56d75e 100644 (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;
     }