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 <phil@xxxxxx> --- iptables/ip6tables.c | 4 ++-- iptables/iptables.c | 4 ++-- iptables/xtables-eb.c | 4 ++-- iptables/xtables.c | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/iptables/ip6tables.c b/iptables/ip6tables.c index c7d2377906e0c..80b3e86accb43 100644 --- a/iptables/ip6tables.c +++ b/iptables/ip6tables.c @@ -1013,8 +1013,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 cc17f8d4e5ce7..eabd35e278025 100644 --- a/iptables/iptables.c +++ b/iptables/iptables.c @@ -995,8 +995,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 5ac122971c644..382b108ed0fc7 100644 --- a/iptables/xtables-eb.c +++ b/iptables/xtables-eb.c @@ -895,8 +895,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 adf03b9348bd3..85f7664d7ac1c 100644 --- a/iptables/xtables.c +++ b/iptables/xtables.c @@ -513,8 +513,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", -- 2.33.0