From 73f9f3323710c0ddb4f64b9dee001727e4925b27 Mon Sep 17 00:00:00 2001 From: sbbs <> Date: Fri, 21 May 2010 21:40:47 +0000 Subject: [PATCH] Fix active FTP bug (with PORT command) on platforms with a 64-bit long int (e.g. Linux-64) --- src/sbbs3/ftpsrvr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sbbs3/ftpsrvr.c b/src/sbbs3/ftpsrvr.c index 0360e3bb1c..97937568f0 100644 --- a/src/sbbs3/ftpsrvr.c +++ b/src/sbbs3/ftpsrvr.c @@ -2354,7 +2354,7 @@ static void ctrl_thread(void* arg) WORD port; uint32_t ip_addr; socklen_t addr_len; - DWORD h1,h2,h3,h4; + unsigned h1,h2,h3,h4; u_short p1,p2; /* For PORT command */ int i; int rd; @@ -2866,7 +2866,7 @@ static void ctrl_thread(void* arg) p=cmd+5; SKIP_WHITESPACE(p); - sscanf(p,"%ld,%ld,%ld,%ld,%hd,%hd",&h1,&h2,&h3,&h4,&p1,&p2); + sscanf(p,"%u,%u,%u,%u,%hd,%hd",&h1,&h2,&h3,&h4,&p1,&p2); data_addr.sin_addr.s_addr=htonl((h1<<24)|(h2<<16)|(h3<<8)|h4); data_addr.sin_port=(u_short)((p1<<8)|p2); if(data_addr.sin_port< IPPORT_RESERVED) { -- GitLab