aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2014-11-27 22:42:03 -0500
committerNick Mathewson <nickm@torproject.org>2014-11-27 22:42:03 -0500
commit0e0dc7d787ef867a24b2e630bf1db72227b24fef (patch)
tree4c5320bb813bca65af607f8b877eeed25261f758 /src
parenta28df3fb6713043e801fb5fcf5019fc0539b5066 (diff)
downloadtor-0e0dc7d787ef867a24b2e630bf1db72227b24fef.tar.gz
tor-0e0dc7d787ef867a24b2e630bf1db72227b24fef.zip
Fix a 64-bit clang warning
Diffstat (limited to 'src')
-rw-r--r--src/or/channeltls.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/or/channeltls.c b/src/or/channeltls.c
index 719a153dd6..90ad1e679f 100644
--- a/src/or/channeltls.c
+++ b/src/or/channeltls.c
@@ -741,7 +741,7 @@ static int
channel_tls_num_cells_writeable_method(channel_t *chan)
{
size_t outbuf_len;
- int n;
+ ssize_t n;
channel_tls_t *tlschan = BASE_CHAN_TO_TLS(chan);
size_t cell_network_size;
@@ -753,8 +753,11 @@ channel_tls_num_cells_writeable_method(channel_t *chan)
/* Get the number of cells */
n = CEIL_DIV(OR_CONN_HIGHWATER - outbuf_len, cell_network_size);
if (n < 0) n = 0;
+#if SIZEOF_SIZE_T > SIZEOF_INT
+ if (n > INT_MAX) n = INT_MAX;
+#endif
- return n;
+ return (int)n;
}
/**