From 85877dae9af9c47df2e3cd27c904013fe676b150 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Wed, 17 Oct 2007 00:10:00 +0000 Subject: Fix compiler warning: comparison between signed and unsigned --- lib/connect.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/connect.c b/lib/connect.c index 918602c2d..1f4562a9a 100644 --- a/lib/connect.c +++ b/lib/connect.c @@ -692,8 +692,9 @@ singleipconnect(struct connectdata *conn, addr->family=ai->ai_family; addr->socktype=conn->socktype; addr->protocol=ai->ai_protocol; - addr->addrlen=(ai->ai_addrlen<=sizeof(struct Curl_sockaddr_storage))? - ai->ai_addrlen:sizeof(struct Curl_sockaddr_storage); + addr->addrlen = + (ai->ai_addrlen < (socklen_t)sizeof(struct Curl_sockaddr_storage)) ? + ai->ai_addrlen : (socklen_t)sizeof(struct Curl_sockaddr_storage); memcpy(&addr->addr, ai->ai_addr, addr->addrlen); /* optionally use callback to get the socket */ -- cgit v1.2.3