]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
mingw/windows printf lacks %zd ; use %lu and casts instead
authorNick Mathewson <nickm@torproject.org>
Tue, 20 Jun 2017 16:12:55 +0000 (12:12 -0400)
committerNick Mathewson <nickm@torproject.org>
Tue, 20 Jun 2017 16:12:55 +0000 (12:12 -0400)
(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.

src/common/compress.c

index e65894d9d2e37e1b9e3c2b1a19af28f780214b93..c16d1b51ee7b7f7987404d2bb5bdeb446afb0451 100644 (file)
@@ -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;