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/expr/bitwise.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/expr/bitwise.c') diff --git a/src/expr/bitwise.c b/src/expr/bitwise.c index f293069..0be1593 100644 --- a/src/expr/bitwise.c +++ b/src/expr/bitwise.c @@ -283,20 +283,20 @@ nft_rule_expr_bitwise_snprintf_json(char *buf, size_t size, { int len = size, offset = 0, ret; - ret = snprintf(buf, len, "\"sreg\" : %u, " - "\"dreg\" : %u, " - "\"len\" : %u, ", + ret = snprintf(buf, len, "\"sreg\":%u," + "\"dreg\":%u," + "\"len\":%u,", bitwise->sreg, bitwise->dreg, bitwise->len); SNPRINTF_BUFFER_SIZE(ret, size, len, offset); - ret = snprintf(buf+offset, len, "\"mask\" : {"); + ret = snprintf(buf+offset, len, "\"mask\":{"); SNPRINTF_BUFFER_SIZE(ret, size, len, offset); ret = nft_data_reg_snprintf(buf+offset, len, &bitwise->mask, NFT_RULE_O_JSON, 0, DATA_VALUE); SNPRINTF_BUFFER_SIZE(ret, size, len, offset); - ret = snprintf(buf+offset, len, "}, \"xor\" : {"); + ret = snprintf(buf+offset, len, "},\"xor\":{"); SNPRINTF_BUFFER_SIZE(ret, size, len, offset); ret = nft_data_reg_snprintf(buf+offset, len, &bitwise->xor, -- cgit v1.2.3