summaryrefslogtreecommitdiff
path: root/lib/transfer.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/transfer.c')
-rw-r--r--lib/transfer.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/transfer.c b/lib/transfer.c
index d44929407..b20204605 100644
--- a/lib/transfer.c
+++ b/lib/transfer.c
@@ -2012,14 +2012,16 @@ Curl_Transfer(struct connectdata *c_conn, /* connection data */
if(!conn)
return CURLE_BAD_FUNCTION_ARGUMENT;
- curlassert(sockindex <= 1);
+ curlassert((sockindex <= 1) && (sockindex >= -1));
/* now copy all input parameters */
- conn->sockfd = sockindex==-1?-1:conn->sock[sockindex];
+ conn->sockfd = sockindex==-1?
+ CURL_SOCKET_BAD:conn->sock[sockindex];
conn->size = size;
conn->bits.getheader = getheader;
conn->bytecountp = bytecountp;
- conn->writesockfd = writesockindex==-1?-1:conn->sock[writesockindex];
+ conn->writesockfd = writesockindex==-1?
+ CURL_SOCKET_BAD:conn->sock[writesockindex];
conn->writebytecountp = writecountp;
return CURLE_OK;