From ec4b60bebcab23d46aa09bed06018457c35e5afa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Neira=20Ayuso?= Date: Sun, 13 Oct 2013 21:52:34 +0200 Subject: src: json: remove spaces Remove all the spaces from the JSON output to reduce the size of the output string, this also provides a consistent output in table, chain, rule and set. As Stephen Hemminger suggested, better to squash the output to consume as less bytes as possible. Signed-off-by: Alvaro Neira Ayuso Signed-off-by: Pablo Neira Ayuso --- src/table.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/table.c') diff --git a/src/table.c b/src/table.c index 7f14b32..d3ff188 100644 --- a/src/table.c +++ b/src/table.c @@ -349,10 +349,10 @@ EXPORT_SYMBOL(nft_table_parse); static int nft_table_snprintf_json(char *buf, size_t size, struct nft_table *t) { return snprintf(buf, size, - "{\"table\" : {" - "\"name\" : \"%s\"," - "\"family\" : \"%s\"," - "\"flags\" : %d" + "{\"table\":{" + "\"name\":\"%s\"," + "\"family\":\"%s\"," + "\"flags\":%d" "}" "}" , t->name, nft_family2str(t->family), t->table_flags); -- cgit v1.2.3