From 66b4a68de2212f3f872dc1b0e36aa8e76c70659d Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Fri, 7 Jan 2022 16:26:30 +0100 Subject: Drop extra newline from xtables_error() calls Since basic_exit_err() appends a newline to the message itself, drop explicit ones. While being at it, fix indentation and join texts split over multiple lines. Signed-off-by: Phil Sutter --- iptables/xshared.c | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) (limited to 'iptables/xshared.c') diff --git a/iptables/xshared.c b/iptables/xshared.c index 0beacee6..d400dc59 100644 --- a/iptables/xshared.c +++ b/iptables/xshared.c @@ -400,15 +400,15 @@ bool tokenize_rule_counters(char **bufferp, char **pcntp, char **bcntp, int line ptr = strchr(buffer, ']'); if (!ptr) - xtables_error(PARAMETER_PROBLEM, "Bad line %u: need ]\n", line); + xtables_error(PARAMETER_PROBLEM, "Bad line %u: need ]", line); pcnt = strtok(buffer+1, ":"); if (!pcnt) - xtables_error(PARAMETER_PROBLEM, "Bad line %u: need :\n", line); + xtables_error(PARAMETER_PROBLEM, "Bad line %u: need :", line); bcnt = strtok(NULL, "]"); if (!bcnt) - xtables_error(PARAMETER_PROBLEM, "Bad line %u: need ]\n", line); + xtables_error(PARAMETER_PROBLEM, "Bad line %u: need ]", line); *pcntp = pcnt; *bcntp = bcnt; @@ -433,10 +433,10 @@ void add_argv(struct argv_store *store, const char *what, int quoted) if (store->argc + 1 >= MAX_ARGC) xtables_error(PARAMETER_PROBLEM, - "Parser cannot handle more arguments\n"); + "Parser cannot handle more arguments"); if (!what) xtables_error(PARAMETER_PROBLEM, - "Trying to store NULL argument\n"); + "Trying to store NULL argument"); store->argv[store->argc] = xtables_strdup(what); store->argvattr[store->argc] = quoted; @@ -900,8 +900,7 @@ static char cmd2char(int option) ; if (i >= ARRAY_SIZE(cmdflags)) xtables_error(OTHER_PROBLEM, - "cmd2char(): Invalid command number %u.\n", - 1 << i); + "cmd2char(): Invalid command number %u.", 1 << i); return cmdflags[i]; } @@ -911,8 +910,8 @@ static void add_command(unsigned int *cmd, const int newcmd, if (invert) xtables_error(PARAMETER_PROBLEM, "unexpected '!' flag"); if (*cmd & (~othercmds)) - xtables_error(PARAMETER_PROBLEM, "Cannot use -%c with -%c\n", - cmd2char(newcmd), cmd2char(*cmd & (~othercmds))); + xtables_error(PARAMETER_PROBLEM, "Cannot use -%c with -%c", + cmd2char(newcmd), cmd2char(*cmd & (~othercmds))); *cmd |= newcmd; } @@ -979,9 +978,8 @@ static void generic_opt_check(int command, int options) if (!(options & (1<