]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
printf: use platform independent length modifiers
authorTomas Krizek <tomas.krizek@nic.cz>
Mon, 21 Jun 2021 12:51:28 +0000 (14:51 +0200)
committerTomas Krizek <tomas.krizek@nic.cz>
Wed, 7 Jul 2021 04:34:06 +0000 (06:34 +0200)
Make sure we use the correct lemgth modifiers to support both 32b and
64b architectures.

daemon/http.c
tests/pytests/proxy/tls-proxy.h
tests/pytests/proxy/tlsproxy.c

index 3055f3d0c9cf61ce22355459302f5a770bc7ab59..e21b0db1408f5a48447c120f2254e8c8e60ae9e8 100644 (file)
@@ -331,7 +331,7 @@ static int header_callback(nghttp2_session *h2, const nghttp2_frame *frame,
                        /* Limit maximum value size to reduce attack surface. */
                        if (valuelen > HTTP_MAX_HEADER_IN_SIZE) {
                                kr_log_verbose(
-                                       "[http] stream %d: header too large (%ld B), refused\n",
+                                       "[http] stream %d: header too large (%zu B), refused\n",
                                        stream_id, valuelen);
                                refuse_stream(h2, stream_id);
                                return 0;
index c6f468d49e4383d8a21630bd86b02746cba4bb00..2dbd9fd81a9a2f5ce1fe2c95a5656e52a6dca614 100644 (file)
@@ -1,6 +1,8 @@
 #pragma once
 /* SPDX-License-Identifier: GPL-3.0-or-later */
 
+#define __STDC_FORMAT_MACROS
+#include <inttypes.h>
 #include <stdint.h>
 #include <stdbool.h>
 #include <netinet/in.h>
index f1b4acc2fb19bc8833a0536ba357299f433d83ec..bcdffb03dfb5fae8c756d0ce4c8c974aa627e074 100644 (file)
@@ -25,7 +25,7 @@ void help(char *argv[], struct args *a)
               " -t, --cert=[path]      Path to certificate file (default: %s).\n"
               " -k, --key=[path]       Path to key file (default: %s).\n"
               " -c, --close=[N]        Close connection to client after\n"
-              "                        every N ms (default: %li).\n"
+              "                        every N ms (default: %" PRIu64 ").\n"
               " -f, --fail=[N]         Delay every Nth incoming connection by 10 sec,\n"
               "                        0 disables delaying (default: 0).\n"
               " -r, --rehandshake      Do TLS rehandshake after every 8 bytes\n"