Blame SOURCES/0003-main-fix-nft-help-output-fallout-from-719e4427.patch

195495
From 5f91359f1bbcd73346e4469f0b5a30e04f107a06 Mon Sep 17 00:00:00 2001
195495
From: =?UTF-8?q?=C5=A0t=C4=9Bp=C3=A1n=20N=C4=9Bmec?= <snemec@redhat.com>
195495
Date: Mon, 22 Feb 2021 13:03:19 +0100
195495
Subject: [PATCH] main: fix nft --help output fallout from 719e4427
195495
MIME-Version: 1.0
195495
Content-Type: text/plain; charset=UTF-8
195495
Content-Transfer-Encoding: 8bit
195495
195495
Long options were missing the double dash.
195495
195495
Fixes: 719e44277f8e ("main: use one data-structure to initialize getopt_long(3) arguments and help.")
195495
Cc: Jeremy Sowden <jeremy@azazel.net>
195495
Signed-off-by: Štěpán Němec <snemec@redhat.com>
195495
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
195495
(cherry picked from commit b8c6dd1a9c0c6e937febc113e7ea89079aa945be)
195495
Signed-off-by: Phil Sutter <psutter@redhat.com>
195495
---
195495
 src/main.c | 7 ++++---
195495
 1 file changed, 4 insertions(+), 3 deletions(-)
195495
195495
diff --git a/src/main.c b/src/main.c
195495
index 80cf1acf0f7f4..8c47064459ecb 100644
195495
--- a/src/main.c
195495
+++ b/src/main.c
195495
@@ -175,16 +175,17 @@ static const struct option *get_options(void)
195495
 
195495
 static void print_option(const struct nft_opt *opt)
195495
 {
195495
-	char optbuf[33] = "";
195495
+	char optbuf[35] = "";
195495
 	int i;
195495
 
195495
 	i = snprintf(optbuf, sizeof(optbuf), "  -%c", opt->val);
195495
 	if (opt->name)
195495
-		i += snprintf(optbuf + i, sizeof(optbuf) - i, ", %s", opt->name);
195495
+		i += snprintf(optbuf + i, sizeof(optbuf) - i, ", --%s",
195495
+			      opt->name);
195495
 	if (opt->arg)
195495
 		i += snprintf(optbuf + i, sizeof(optbuf) - i, " %s", opt->arg);
195495
 
195495
-	printf("%-32s%s\n", optbuf, opt->help);
195495
+	printf("%-34s%s\n", optbuf, opt->help);
195495
 }
195495
 
195495
 static void show_help(const char *name)
195495
-- 
195495
2.31.1
195495