diff options
| author | Stefan Farfeleder <stefanf@FreeBSD.org> | 2005-02-14 17:55:33 +0000 |
|---|---|---|
| committer | Stefan Farfeleder <stefanf@FreeBSD.org> | 2005-02-14 17:55:33 +0000 |
| commit | 1ad041fed3a619d1ab238b36752da135f334bc9b (patch) | |
| tree | 3a81abd3eca952a36e5eedb49cc3cf3ecfc96f52 /lib | |
| parent | 10248e3a93ad693ef26704011214ec987e9c8747 (diff) | |
Notes
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/libftpio/ftpio.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/libftpio/ftpio.c b/lib/libftpio/ftpio.c index 313f42b49a13..dd7f3945d632 100644 --- a/lib/libftpio/ftpio.c +++ b/lib/libftpio/ftpio.c @@ -782,6 +782,7 @@ ftp_login_session(FTP_t ftp, char *host, int af, static int ftp_file_op(FTP_t ftp, char *operation, char *file, FILE **fp, char *mode, off_t *seekto) { + socklen_t sinlen; int i,l,s; char *q; unsigned char addr[64]; @@ -873,7 +874,6 @@ ftp_file_op(FTP_t ftp, char *operation, char *file, FILE **fp, char *mode, off_t } } else if (strcmp(cmdstr, "EPSV") == 0) { int port; - int sinlen; while (*q && *q != '(') /* ) */ q++; if (!*q) { @@ -951,16 +951,16 @@ ftp_file_op(FTP_t ftp, char *operation, char *file, FILE **fp, char *mode, off_t } #endif - i = sizeof sin; - getsockname(ftp->fd_ctrl, (struct sockaddr *)&sin, &i); + sinlen = sizeof sin; + getsockname(ftp->fd_ctrl, (struct sockaddr *)&sin, &sinlen); sin.sin4.sin_port = 0; i = ((struct sockaddr *)&sin)->sa_len; if (bind(s, (struct sockaddr *)&sin, i) < 0) { close(s); return FAILURE; } - i = sizeof sin; - getsockname(s,(struct sockaddr *)&sin,&i); + sinline = sizeof sin; + getsockname(s, (struct sockaddr *)&sin, &sinlen); if (listen(s, 1) < 0) { close(s); return FAILURE; |
