From 1ccfa322aa173c44c00bd287b2f61b26cddbdd46 Mon Sep 17 00:00:00 2001 From: Hajimu UMEMOTO Date: Tue, 3 May 2005 16:13:31 +0000 Subject: [PATCH] fix signed/unsigned comparison warnings. Obtained from: NetBSD --- lib/libc/net/getnameinfo.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/libc/net/getnameinfo.c b/lib/libc/net/getnameinfo.c index 08c8a126a841..ab849a785233 100644 --- a/lib/libc/net/getnameinfo.c +++ b/lib/libc/net/getnameinfo.c @@ -60,8 +60,8 @@ __FBSDID("$FreeBSD$"); static const struct afd { int a_af; - int a_addrlen; - int a_socklen; + size_t a_addrlen; + socklen_t a_socklen; int a_off; } afdl [] = { #ifdef INET6 @@ -195,7 +195,7 @@ getnameinfo(sa, salen, host, hostlen, serv, servlen, flags) * hostlen == 0 means that the caller does not want the result. */ } else if (flags & NI_NUMERICHOST) { - int numaddrlen; + size_t numaddrlen; /* NUMERICHOST and NAMEREQD conflicts with each other */ if (flags & NI_NAMEREQD) @@ -281,7 +281,7 @@ ip6_parsenumeric(sa, addr, host, hostlen, flags) size_t hostlen; int flags; { - int numaddrlen; + size_t numaddrlen; char numaddr[512]; if (inet_ntop(AF_INET6, addr, numaddr, sizeof(numaddr)) == NULL) @@ -350,7 +350,7 @@ ip6_sa2str(sa6, buf, bufsiz, flags) /* last resort */ n = snprintf(buf, bufsiz, "%u", sa6->sin6_scope_id); - if (n < 0 || n >= bufsiz) + if (n < 0 || (size_t)n >= bufsiz) return -1; else return n;