diff mbox

[nft] rule: simplify ("rule: delete extra space in sets printing")

Message ID 1457083532-1595-1-git-send-email-pablo@netfilter.org
State Accepted
Delegated to: Pablo Neira
Headers show

Commit Message

Pablo Neira Ayuso March 4, 2016, 9:25 a.m. UTC
This simplifies bd23f7628570 ("rule: delete extra space in sets printing")
by passing the whitespace from set_print_plain() called from the monitoring
path.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
 src/rule.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Comments

Arturo Borrero March 4, 2016, 9:55 a.m. UTC | #1
On 4 March 2016 at 10:25, Pablo Neira Ayuso <pablo@netfilter.org> wrote:
> This simplifies bd23f7628570 ("rule: delete extra space in sets printing")
> by passing the whitespace from set_print_plain() called from the monitoring
> path.
>
> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>

Acked-by: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>
diff mbox

Patch

diff --git a/src/rule.c b/src/rule.c
index 2f03b98..0b78549 100644
--- a/src/rule.c
+++ b/src/rule.c
@@ -269,9 +269,6 @@  static void set_print_declaration(const struct set *set,
 
 	printf(" %s {%s", set->handle.set, opts->nl);
 
-	if (!opts->nl[0])
-		printf(" ");
-
 	printf("%s%stype %s", opts->tab, opts->tab, set->keytype->name);
 	if (set->flags & SET_F_MAP)
 		printf(" : %s", set->datatype->name);
@@ -352,7 +349,7 @@  void set_print_plain(const struct set *s)
 {
 	struct print_fmt_options opts = {
 		.tab		= "",
-		.nl		= "",
+		.nl		= " ",
 		.table		= s->handle.table,
 		.family		= family2str(s->handle.family),
 		.stmt_separator	= ";",