]> granicus.if.org Git - curl/commitdiff
security.c: Aligned internal type to return type
authorMarc Hoersken <info@marc-hoersken.de>
Fri, 28 Sep 2012 21:11:57 +0000 (23:11 +0200)
committerMarc Hoersken <info@marc-hoersken.de>
Thu, 4 Oct 2012 17:16:59 +0000 (19:16 +0200)
Use ssize_t instead of int to avoid conversion problems on 64-bit
systems. Also added curlx_sztosi where necessary.

lib/security.c

index 536d7c229be1fe7e6552034105f5c51e9adb3bc9..6201c5566163f92f08c5d0e2ddb449e90961b581 100644 (file)
@@ -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;