summaryrefslogtreecommitdiff
path: root/ftp.c
diff options
context:
space:
mode:
authorewt <devnull@localhost>1996-08-08 17:34:05 +0000
committerewt <devnull@localhost>1996-08-08 17:34:05 +0000
commitfd31424fd3bd5abff9d79b5f9a3638957a5ad6a1 (patch)
tree8ca781cb3967c3e9ab7cdf47a336af8b409687dd /ftp.c
parent6768a41feb80cef1e1798775eb463abb7410fff0 (diff)
downloadrpm-fd31424fd3bd5abff9d79b5f9a3638957a5ad6a1.tar.gz
rpm-fd31424fd3bd5abff9d79b5f9a3638957a5ad6a1.tar.bz2
rpm-fd31424fd3bd5abff9d79b5f9a3638957a5ad6a1.zip
fixed sscanf() to use proper types
CVS patchset: 948 CVS date: 1996/08/08 17:34:05
Diffstat (limited to 'ftp.c')
-rw-r--r--ftp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ftp.c b/ftp.c
index d8e25d827..a2b82632a 100644
--- a/ftp.c
+++ b/ftp.c
@@ -267,7 +267,7 @@ int ftpReadData(int sock, int out) {
int ftpGetFile(int sock, char * remotename, int dest) {
int dataSocket;
struct sockaddr_in dataAddress;
- int i;
+ int i, j;
char * passReply;
char * chptr;
char * retrCommand;
@@ -299,10 +299,10 @@ int ftpGetFile(int sock, char * remotename, int dest) {
port number portion */
dataAddress.sin_family = AF_INET;
- if (sscanf(chptr, "%d,%d", (int *) &dataAddress.sin_port, &i) != 2) {
+ if (sscanf(chptr, "%d,%d", &i, &j) != 2) {
return FTPERR_PASSIVE_ERROR;
}
- dataAddress.sin_port = htons((dataAddress.sin_port << 8) + i);
+ dataAddress.sin_port = htons((i << 8) + j);
chptr = passReply;
while (*chptr++) {