changeset 141:a28c23b468ae

Mac: Fix connection issues on Mac on PowerPC in 64-bit mode. Need to use types with the correct sizes. In 32-bit mode the sizes were correct, but due to endianness and differing sizes in 64-bit mode it failed. Hopefully these types are available on all our supported platforms.
author Brian Smith <brian@dbsoft.org>
date Sun, 03 Oct 2021 14:07:21 -0500
parents b8c3d3f1efa4
children f192e2dbb8a5
files src/handyftp.c
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/handyftp.c	Sun Sep 19 14:08:26 2021 -0500
+++ b/src/handyftp.c	Sun Oct 03 14:07:21 2021 -0500
@@ -3112,7 +3112,7 @@
 
 union ip4_32 {
 	IP4 ip4;
-	unsigned long ip32;
+	uint32_t ip32;
 };
 
 /* Parses out IP information from a string returned from the server */
@@ -3499,7 +3499,7 @@
 				else
 				{
 					struct sockaddr_in si;
-					int ipaddr = 0;
+					in_addr_t ipaddr = 0;
 					socklen_t sisize;
 
 					dw_mutex_unlock(h);
@@ -3520,7 +3520,7 @@
 							setstatustext(threadsite, locale_string("Remote directory, disconnected.", 100));
 						}
 						else
-							ipaddr = *((unsigned long *)hostnm->h_addr);
+							ipaddr = *((in_addr_t *)hostnm->h_addr);
 					}
 
 					if(ipaddr && ipaddr != -1)