diff mbox series

[iproute2-next,11/11] tunnel: fix clang warning

Message ID 20220108204650.36185-12-sthemmin@microsoft.com (mailing list archive)
State Changes Requested
Delegated to: David Ahern
Headers show
Series Clang warning fixes | expand

Checks

Context Check Description
netdev/tree_selection success Not a local patch

Commit Message

Stephen Hemminger Jan. 8, 2022, 8:46 p.m. UTC
To fix clang warning about passing non-format string split the
print into two calls.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 ip/tunnel.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/ip/tunnel.c b/ip/tunnel.c
index 88585cf3177b..9d1a745d9d2d 100644
--- a/ip/tunnel.c
+++ b/ip/tunnel.c
@@ -301,10 +301,8 @@  void tnl_print_endpoint(const char *name, const struct rtattr *rta, int family)
 	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(PRINT_FP, NULL, "%s ", name);
+		print_string(PRINT_FP, NULL, "%s ",value);
 	}
 }