From c382c550e7d8ad54d2c35b0fea9d0eef09ff3a25 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Tue, 14 Apr 2009 12:53:53 +0000 Subject: fix compiler warning: implicit conversion shortens 64-bit value into a 32-bit value --- lib/qssl.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/qssl.c') diff --git a/lib/qssl.c b/lib/qssl.c index 2dd46c35c..bf4e5f798 100644 --- a/lib/qssl.c +++ b/lib/qssl.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2008, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2009, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -419,9 +419,11 @@ ssize_t Curl_qsossl_recv(struct connectdata * conn, int num, char * buf, char error_buffer[120]; /* OpenSSL documents that this must be at least 120 bytes long. */ unsigned long sslerror; + int buffsize; int nread; - nread = SSL_Read(conn->ssl[num].handle, buf, (int) buffersize); + buffsize = (buffersize > (size_t)INT_MAX) ? INT_MAX : (int)buffersize; + nread = SSL_Read(conn->ssl[num].handle, buf, buffsize); *wouldblock = FALSE; if(nread < 0) { -- cgit v1.2.3