aboutsummaryrefslogtreecommitdiff
path: root/src/common/compress.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-06-20 12:12:55 -0400
committerNick Mathewson <nickm@torproject.org>2017-06-20 12:12:55 -0400
commit945256188ab3a9b5842455f714d51e1871b0bf69 (patch)
tree326bc36901d5d82ac210df3cdd60ce6bc4b2750d /src/common/compress.c
parentc1c938e80cc96e13b1f87e6c33220026341cbb26 (diff)
downloadtor-945256188ab3a9b5842455f714d51e1871b0bf69.tar.gz
tor-945256188ab3a9b5842455f714d51e1871b0bf69.zip
mingw/windows printf lacks %zd ; use %lu and casts instead
(This approach can lose accuracy, but it's only in debug-level messages.) Fixes windows compilation. Bugfix on recent compress.c changes; bug not in any released Tor.
Diffstat (limited to 'src/common/compress.c')
-rw-r--r--src/common/compress.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/common/compress.c b/src/common/compress.c
index e65894d9d2..c16d1b51ee 100644
--- a/src/common/compress.c
+++ b/src/common/compress.c
@@ -105,8 +105,8 @@ tor_compress_impl(int compress,
if (stream == NULL) {
log_warn(LD_GENERAL, "NULL stream while %scompressing",
compress?"":"de");
- log_debug(LD_GENERAL, "method: %d level: %d at len: %zd",
- method, compression_level, in_len);
+ log_debug(LD_GENERAL, "method: %d level: %d at len: %lu",
+ method, compression_level, (unsigned long)in_len);
return -1;
}
@@ -146,15 +146,15 @@ tor_compress_impl(int compress,
"Unexpected %s while %scompressing",
complete_only?"end of input":"result",
compress?"":"de");
- log_debug(LD_GENERAL, "method: %d level: %d at len: %zd",
- method, compression_level, in_len);
+ log_debug(LD_GENERAL, "method: %d level: %d at len: %lu",
+ method, compression_level, (unsigned long)in_len);
goto err;
} else {
if (in_len != 0) {
log_fn(protocol_warn_level, LD_PROTOCOL,
"Unexpected extra input while decompressing");
- log_debug(LD_GENERAL, "method: %d level: %d at len: %zd",
- method, compression_level, in_len);
+ log_debug(LD_GENERAL, "method: %d level: %d at len: %lu",
+ method, compression_level, (unsigned long)in_len);
goto err;
} else {
goto done;