From abd02d7387069439373d40c2f9afba93c76df650 Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Wed, 8 Oct 2003 19:35:20 +0000 Subject: Atsushi Nemoto writes: I found inappropriate data types are used in some places in networking codes. * tcp_seq is 32bit (u_long -> u_int32_t) * in_addt_t should be used for internet address (unsigned long -> in_addr_t) * socklen_t should be used for accept() This is a patch against uclibc-0.9.21 (can be applied for current CVS). 64bit platforms (sizeof(int)!=sizeof(long)) will need this. I believe this patch does not harm any 32bit platforms. --- libc/inet/rpc/rcmd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libc/inet/rpc/rcmd.c') diff --git a/libc/inet/rpc/rcmd.c b/libc/inet/rpc/rcmd.c index 618a6f1b2..f1c732d41 100644 --- a/libc/inet/rpc/rcmd.c +++ b/libc/inet/rpc/rcmd.c @@ -192,7 +192,7 @@ int rcmd(ahost, rport, locuser, remuser, cmd, fd2p) } else { char num[8]; int s2 = rresvport(&lport), s3; - size_t len = sizeof(from); + socklen_t len = sizeof(from); if (s2 < 0) goto bad; @@ -541,7 +541,7 @@ __icheckhost (u_int32_t raddr, char *lhost, const char *rhost) } /* Try for raw ip address first. */ - if (isdigit (*lhost) && (long) (laddr = inet_addr (lhost)) != -1) + if (isdigit (*lhost) && (laddr = inet_addr (lhost)) != INADDR_NONE) return negate * (! (raddr ^ laddr)); /* Better be a hostname. */ -- cgit v1.2.3