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/set_elem.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/set_elem.c') diff --git a/src/set_elem.c b/src/set_elem.c index ba24c96..5bb82f6 100644 --- a/src/set_elem.c +++ b/src/set_elem.c @@ -454,10 +454,10 @@ static int nft_set_elem_snprintf_json(char *buf, size_t size, { int ret, len = size, offset = 0, type = -1; - ret = snprintf(buf, len, "\"flags\": %u", e->set_elem_flags); + ret = snprintf(buf, len, "\"flags\":%u", e->set_elem_flags); SNPRINTF_BUFFER_SIZE(ret, size, len, offset); - ret = snprintf(buf+offset, len, ",\"key\": {"); + ret = snprintf(buf+offset, len, ",\"key\":{"); SNPRINTF_BUFFER_SIZE(ret, size, len, offset); ret = nft_data_reg_snprintf(buf+offset, len, &e->key, @@ -475,7 +475,7 @@ static int nft_set_elem_snprintf_json(char *buf, size_t size, type = DATA_VERDICT; if (type != -1) { - ret = snprintf(buf+offset, len, ",\"data\": {"); + ret = snprintf(buf+offset, len, ",\"data\":{"); SNPRINTF_BUFFER_SIZE(ret, size, len, offset); ret = nft_data_reg_snprintf(buf+offset, len, &e->data, -- cgit v1.2.3