]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
tunnel: fix clang warning
authorStephen Hemminger <stephen@networkplumber.org>
Tue, 11 Jan 2022 17:54:36 +0000 (09:54 -0800)
committerDavid Ahern <dsahern@kernel.org>
Wed, 26 Jan 2022 17:19:08 +0000 (10:19 -0700)
To fix clang warning about passing non-format string.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: David Ahern <dsahern@kernel.org>
ip/tunnel.c

index 88585cf3177b598dd11fd1bf2d712f004eb068af..f2632f43babf2e43bc807259272eabdc3d21e336 100644 (file)
@@ -298,14 +298,7 @@ void tnl_print_endpoint(const char *name, const struct rtattr *rta, int family)
                        value = "unknown";
        }
 
-       if (is_json_context()) {
-               print_string(PRINT_JSON, name, NULL, value);
-       } else {
-               SPRINT_BUF(b1);
-
-               snprintf(b1, sizeof(b1), "%s %%s ", name);
-               print_string(PRINT_FP, NULL, b1, value);
-       }
+       print_string_name_value(name, value);
 }
 
 void tnl_print_gre_flags(__u8 proto,