From 9a883adf954c2f68085a398e8ab38bd54831cf52 Mon Sep 17 00:00:00 2001 From: Jan Moskyto Matejka Date: Mon, 11 Jan 2016 11:03:11 +0100 Subject: [PATCH] Net address format: Do not print the -4 or -6 suffix in %I4 and %I6 --- lib/printf.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/printf.c b/lib/printf.c index ce12202c..318cee2c 100644 --- a/lib/printf.c +++ b/lib/printf.c @@ -295,11 +295,13 @@ int bvsnprintf(char *buf, int size, const char *fmt, va_list args) ip4_addr a = va_arg(args, ip4_addr); ip4_ntop(a, ipbuf); i = IP4_MAX_TEXT_LENGTH; + fmt++; } else if (fmt[1] == '6') { /* Explicit IPv6 address */ ip6_addr a = va_arg(args, ip6_addr); ip6_ntop(a, ipbuf); i = IP6_MAX_TEXT_LENGTH; + fmt++; } else { /* Just IP address */ ip_addr a = va_arg(args, ip_addr);