]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Net address format: Do not print the -4 or -6 suffix in %I4 and %I6
authorJan Moskyto Matejka <mq@ucw.cz>
Mon, 11 Jan 2016 10:03:11 +0000 (11:03 +0100)
committerJan Moskyto Matejka <mq@ucw.cz>
Wed, 13 Jan 2016 12:21:25 +0000 (13:21 +0100)
lib/printf.c

index ce12202ccd9a68490a7b5398362832b95fa8793f..318cee2c39b90f7df6b7f0a11ce830c936cad91f 100644 (file)
@@ -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);