Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/ftp Fix some cast issues highlighted by Scott Reynol...



details:   https://anonhg.NetBSD.org/src/rev/ea9b44873685
branches:  trunk
changeset: 580885:ea9b44873685
user:      lukem <lukem%NetBSD.org@localhost>
date:      Sat May 14 15:26:43 2005 +0000

description:
Fix some cast issues highlighted by Scott Reynolds using gcc 4 on OSX.4

diffstat:

 usr.bin/ftp/extern.h  |   4 ++--
 usr.bin/ftp/fetch.c   |   7 ++++---
 usr.bin/ftp/ftp.c     |  23 +++++++++++++----------
 usr.bin/ftp/version.h |   4 ++--
 4 files changed, 21 insertions(+), 17 deletions(-)

diffs (165 lines):

diff -r 5f1443104b7f -r ea9b44873685 usr.bin/ftp/extern.h
--- a/usr.bin/ftp/extern.h      Sat May 14 15:17:47 2005 +0000
+++ b/usr.bin/ftp/extern.h      Sat May 14 15:26:43 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: extern.h,v 1.66 2005/04/11 01:49:31 lukem Exp $        */
+/*     $NetBSD: extern.h,v 1.67 2005/05/14 15:26:43 lukem Exp $        */
 
 /*-
  * Copyright (c) 1996-2005 The NetBSD Foundation, Inc.
@@ -248,7 +248,7 @@
 void   updateremotecwd(void);
 void   usage(void);
 void   user(int, char **);
-int    xconnect(int, const struct sockaddr *, int);
+int    xconnect(int, const struct sockaddr *, socklen_t);
 int    xlisten(int, int);
 int    xpoll(struct pollfd *, int, int);
 void   *xmalloc(size_t);
diff -r 5f1443104b7f -r ea9b44873685 usr.bin/ftp/fetch.c
--- a/usr.bin/ftp/fetch.c       Sat May 14 15:17:47 2005 +0000
+++ b/usr.bin/ftp/fetch.c       Sat May 14 15:26:43 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fetch.c,v 1.157 2005/04/11 01:49:31 lukem Exp $        */
+/*     $NetBSD: fetch.c,v 1.158 2005/05/14 15:26:43 lukem Exp $        */
 
 /*-
  * Copyright (c) 1997-2004 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: fetch.c,v 1.157 2005/04/11 01:49:31 lukem Exp $");
+__RCSID("$NetBSD: fetch.c,v 1.158 2005/05/14 15:26:43 lukem Exp $");
 #endif /* not lint */
 
 /*
@@ -218,7 +218,8 @@
        (void)strlcpy(*response, scheme, rlen);
        len = strlcat(*response, " ", rlen);
                        /* use  `clen - 1'  to not encode the trailing NUL */
-       base64_encode(clear, clen - 1, (unsigned char *)*response + len);
+       base64_encode((unsigned char *)clear, clen - 1,
+           (unsigned char *)*response + len);
        memset(clear, 0, clen);
        rval = 0;
 
diff -r 5f1443104b7f -r ea9b44873685 usr.bin/ftp/ftp.c
--- a/usr.bin/ftp/ftp.c Sat May 14 15:17:47 2005 +0000
+++ b/usr.bin/ftp/ftp.c Sat May 14 15:26:43 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ftp.c,v 1.131 2005/05/13 05:03:49 lukem Exp $  */
+/*     $NetBSD: ftp.c,v 1.132 2005/05/14 15:26:43 lukem Exp $  */
 
 /*-
  * Copyright (c) 1996-2005 The NetBSD Foundation, Inc.
@@ -99,7 +99,7 @@
 #if 0
 static char sccsid[] = "@(#)ftp.c      8.6 (Berkeley) 10/27/94";
 #else
-__RCSID("$NetBSD: ftp.c,v 1.131 2005/05/13 05:03:49 lukem Exp $");
+__RCSID("$NetBSD: ftp.c,v 1.132 2005/05/14 15:26:43 lukem Exp $");
 #endif
 #endif /* not lint */
 
@@ -164,11 +164,12 @@
 char *
 hookup(char *host, char *port)
 {
-       int s = -1, len, error, portnum;
+       int s = -1, error, portnum;
        struct addrinfo hints, *res, *res0;
        char hbuf[MAXHOSTNAMELEN];
        static char hostnamebuf[MAXHOSTNAMELEN];
        char *cause = "unknown";
+       socklen_t len;
        int on = 1;
 
        memset((char *)&hisctladdr, 0, sizeof (hisctladdr));
@@ -261,7 +262,7 @@
        res0 = res = NULL;
 
        len = hisctladdr.su_len;
-       if (getsockname(s, (struct sockaddr *)&myctladdr.si_su, &len) < 0) {
+       if (getsockname(s, (struct sockaddr *)&myctladdr.si_su, &len) == -1) {
                warn("getsockname");
                code = -1;
                goto bad;
@@ -570,7 +571,7 @@
 abortxfer(int notused)
 {
        char msgbuf[100];
-       int len;
+       size_t len;
 
        sigint_raised = 1;
        alarmtimer(0);
@@ -1270,11 +1271,12 @@
 initconn(void)
 {
        char *p, *a;
-       int result, len, tmpno = 0;
+       int result, tmpno = 0;
        int on = 1;
        int error;
        u_int addr[16], port[2];
        u_int af, hal, pal;
+       socklen_t len;
        char *pasvcmd = NULL;
 
 #ifdef INET6
@@ -1574,7 +1576,7 @@
        }
        len = sizeof(data_addr.si_su);
        memset((char *)&data_addr, 0, sizeof (data_addr));
-       if (getsockname(data, (struct sockaddr *)&data_addr.si_su, &len) < 0) {
+       if (getsockname(data, (struct sockaddr *)&data_addr.si_su, &len) == -1) {
                warn("getsockname");
                goto bad;
        }
@@ -1689,9 +1691,10 @@
 dataconn(const char *lmode)
 {
        struct sockinet from;
-       int             s, fromlen, flags, rv, timeout;
+       int             s, flags, rv, timeout;
        struct timeval  endtime, now, td;
        struct pollfd   pfd[1];
+       socklen_t       fromlen;
 
        if (passivemode)        /* passive data connection */
                return (fdopen(data, lmode));
@@ -2081,7 +2084,7 @@
 abort_squared(int dummy)
 {
        char msgbuf[100];
-       int len;
+       size_t len;
 
        sigint_raised = 1;
        alarmtimer(0);
@@ -2140,7 +2143,7 @@
 #ifdef INET6
        struct sockaddr_in6 *sin6;
        struct sockaddr_in sin;
-       int len;
+       socklen_t len;
 
        if (ai->ai_family != AF_INET6)
                return;
diff -r 5f1443104b7f -r ea9b44873685 usr.bin/ftp/version.h
--- a/usr.bin/ftp/version.h     Sat May 14 15:17:47 2005 +0000
+++ b/usr.bin/ftp/version.h     Sat May 14 15:26:43 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: version.h,v 1.49 2005/05/13 05:03:49 lukem Exp $       */
+/*     $NetBSD: version.h,v 1.50 2005/05/14 15:26:43 lukem Exp $       */
 /*-
  * Copyright (c) 1999-2005 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -40,5 +40,5 @@
 #endif
 
 #ifndef FTP_VERSION
-#define        FTP_VERSION     "20050513"
+#define        FTP_VERSION     "20050514"
 #endif



Home | Main Index | Thread Index | Old Index