aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2007-10-17 00:44:48 +0000
committerYang Tse <yangsita@gmail.com>2007-10-17 00:44:48 +0000
commit949073d44884203dcf0285a7c9f4ab477e6a0da9 (patch)
tree6734adf1ac886b243f2be11fadef1f6a06c8ad0e /lib
parent85877dae9af9c47df2e3cd27c904013fe676b150 (diff)
Fix compiler warning: signed and unsigned type in conditional expression
Diffstat (limited to 'lib')
-rw-r--r--lib/connect.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/connect.c b/lib/connect.c
index 1f4562a9a..2ab97eb8d 100644
--- a/lib/connect.c
+++ b/lib/connect.c
@@ -697,11 +697,12 @@ singleipconnect(struct connectdata *conn,
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 */
- sockfd = (data->set.fopensocket)?
- data->set.fopensocket(data->set.opensocket_client, CURLSOCKTYPE_IPCXN,
- addr):
- socket(addr->family, addr->socktype, addr->protocol);
+ /* If set, use opensocket callback to get the socket */
+ if(data->set.fopensocket)
+ sockfd = data->set.fopensocket(data->set.opensocket_client,
+ CURLSOCKTYPE_IPCXN, addr);
+ else
+ sockfd = socket(addr->family, addr->socktype, addr->protocol);
if (sockfd == CURL_SOCKET_BAD)
return CURL_SOCKET_BAD;