From b6f9c55a301654891288ef11358290ce67519930 Mon Sep 17 00:00:00 2001 From: renwang Date: Tue, 3 Dec 2024 15:55:57 +0800 Subject: [PATCH] second --- iptables/iptables.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/iptables/iptables.c b/iptables/iptables.c index 88ef6cf..fba69a9 100644 --- a/iptables/iptables.c +++ b/iptables/iptables.c @@ -478,10 +478,10 @@ print_firewall(const struct ipt_entry *fw, fputc(fw->ip.invflags & XT_INV_PROTO ? '!' : ' ', stdout); { const char *pname = proto_to_name(fw->ip.proto, format&FMT_NUMERIC); - if (pname) - printf(FMT("%-5s", "%s "), pname); - else - printf(FMT("%-5hu", "%hu "), fw->ip.proto); + if (((format & (FMT_NUMERIC | FMT_NOTABLE)) == FMT_NUMERIC) || !pname) + printf(FMT("%-4hu ", "%hu "),fw->ip.proto); + else + printf(FMT("%-4s ", "%s "), pname); } if (format & FMT_OPTIONS) { -- 2.20.1