summaryrefslogtreecommitdiff
path: root/lib/security.c
diff options
context:
space:
mode:
authorMarc Hoersken <info@marc-hoersken.de>2012-09-28 23:11:57 +0200
committerMarc Hoersken <info@marc-hoersken.de>2012-10-04 19:16:59 +0200
commit50a7d32af05687eef53e58ad5314a6bea2fd6a3e (patch)
tree346377136c8a54e40e4fee90faf4438d09ccd6cd /lib/security.c
parenta5c6ecba8dc71d48beba772c4dcceb92fa6b3b00 (diff)
downloadcurl-50a7d32af05687eef53e58ad5314a6bea2fd6a3e.tar.gz
security.c: Aligned internal type to return type
Use ssize_t instead of int to avoid conversion problems on 64-bit systems. Also added curlx_sztosi where necessary.
Diffstat (limited to 'lib/security.c')
-rw-r--r--lib/security.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/security.c b/lib/security.c
index 536d7c229..6201c5566 100644
--- a/lib/security.c
+++ b/lib/security.c
@@ -340,10 +340,10 @@ static ssize_t sec_write(struct connectdata *conn, curl_socket_t fd,
const char *buffer, size_t length)
{
/* FIXME: Check for overflow */
- ssize_t len = conn->buffer_size;
- int tx = 0;
+ ssize_t tx = 0, len = conn->buffer_size;
- len -= conn->mech->overhead(conn->app_data, conn->data_prot, len);
+ len -= conn->mech->overhead(conn->app_data, conn->data_prot,
+ curlx_sztosi(len));
if(len <= 0)
len = length;
while(length) {
@@ -351,7 +351,7 @@ static ssize_t sec_write(struct connectdata *conn, curl_socket_t fd,
/* FIXME: Check for overflow. */
len = length;
}
- do_sec_send(conn, fd, buffer, len);
+ do_sec_send(conn, fd, buffer, curlx_sztosi(len));
length -= len;
buffer += len;
tx += len;