]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Fix format specifier for printing size_t on 32bit size_t platforms
authorArne Schwabe <arne@rfc2549.org>
Wed, 4 May 2022 11:31:58 +0000 (13:31 +0200)
committerGert Doering <gert@greenie.muc.de>
Thu, 5 May 2022 13:48:46 +0000 (15:48 +0200)
Today even 32 bit platform generally use a 64bit size_t but Android
armeabi-v7a is an expection to that and uses a 32bit size_t. Use
z as correct specifier for a size_t.

Clang complained about this:

warning: format specifies type 'unsigned long' but the
argument has type 'size_t' (aka 'unsigned int') [-Wformat]

Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <20220504113158.1051861-1-arne@rfc2549.org>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg24277.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/init.c

index 09264361942083ed70a039118def806395dedb3a..5aaac1a98b83ac844f84f86b2b5e3e9a1c83a1b7 100644 (file)
@@ -2426,7 +2426,7 @@ get_frame_mtu(struct context *c, const struct options *o)
 
     if (mtu < TUN_MTU_MIN)
     {
-        msg(M_WARN, "TUN MTU value (%lu) must be at least %d", mtu, TUN_MTU_MIN);
+        msg(M_WARN, "TUN MTU value (%zu) must be at least %d", mtu, TUN_MTU_MIN);
         frame_print(&c->c2.frame, M_FATAL, "MTU is too small");
     }
     return mtu;