From: Phil Sutter Date: Fri, 26 Nov 2021 20:45:12 +0000 (+0100) Subject: iptables-*-restore: Drop pointless line reference X-Git-Tag: v1.8.8~83 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b129b1cfcdbc82430cbbb90e83c344a14e77a808;p=thirdparty%2Fiptables.git iptables-*-restore: Drop pointless line reference There's no need to mention the offending line number in error message when calling xtables_error() with a status of PARAMETER_PROBLEM as that will cause a call to xtables_exit_tryhelp() which in turn prints "Error occurred at line: N". Signed-off-by: Phil Sutter --- diff --git a/iptables/ip6tables.c b/iptables/ip6tables.c index 2f3ff034..b4604f83 100644 --- a/iptables/ip6tables.c +++ b/iptables/ip6tables.c @@ -1012,8 +1012,8 @@ int do_command6(int argc, char *argv[], char **table, "unexpected ! flag before --table"); if (restore && table_set) xtables_error(PARAMETER_PROBLEM, - "The -t option (seen in line %u) cannot be used in %s.\n", - line, xt_params->program_name); + "The -t option cannot be used in %s.\n", + xt_params->program_name); *table = optarg; table_set = true; break; diff --git a/iptables/iptables.c b/iptables/iptables.c index ba04fbc6..7dc4cbc1 100644 --- a/iptables/iptables.c +++ b/iptables/iptables.c @@ -994,8 +994,8 @@ int do_command4(int argc, char *argv[], char **table, "unexpected ! flag before --table"); if (restore && table_set) xtables_error(PARAMETER_PROBLEM, - "The -t option (seen in line %u) cannot be used in %s.\n", - line, xt_params->program_name); + "The -t option cannot be used in %s.\n", + xt_params->program_name); *table = optarg; table_set = true; break; diff --git a/iptables/xtables-eb.c b/iptables/xtables-eb.c index ed8f7332..060e06c5 100644 --- a/iptables/xtables-eb.c +++ b/iptables/xtables-eb.c @@ -894,8 +894,8 @@ print_zero: ebt_check_option2(&flags, OPT_TABLE); if (restore && table_set) xtables_error(PARAMETER_PROBLEM, - "The -t option (seen in line %u) cannot be used in %s.\n", - line, xt_params->program_name); + "The -t option cannot be used in %s.\n", + xt_params->program_name); if (!nft_table_builtin_find(h, optarg)) xtables_error(VERSION_PROBLEM, "table '%s' does not exist", diff --git a/iptables/xtables.c b/iptables/xtables.c index 5255fa34..57bec76c 100644 --- a/iptables/xtables.c +++ b/iptables/xtables.c @@ -512,8 +512,8 @@ void do_parse(struct nft_handle *h, int argc, char *argv[], "unexpected ! flag before --table"); if (p->restore && table_set) xtables_error(PARAMETER_PROBLEM, - "The -t option (seen in line %u) cannot be used in %s.\n", - line, xt_params->program_name); + "The -t option cannot be used in %s.\n", + xt_params->program_name); if (!nft_table_builtin_find(h, optarg)) xtables_error(VERSION_PROBLEM, "table '%s' does not exist",