]> git.ipfire.org Git - thirdparty/libnftnl.git/commitdiff
rule: json: fix wrong indentation in nft_rule_snprintf_json
authorPablo Neira Ayuso <pablo@netfilter.org>
Tue, 24 Sep 2013 14:56:59 +0000 (16:56 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 24 Sep 2013 15:19:36 +0000 (17:19 +0200)
Comestic cleanup.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/rule.c

index e744cf8acec5c31d78772ee703c62d8904df8e45..b4ce8f1c1966ddb51ab34d8b55d320004864b37a 100644 (file)
@@ -706,10 +706,10 @@ static int nft_rule_snprintf_json(char *buf, size_t size, struct nft_rule *r,
        struct nft_rule_expr *expr;
 
        ret = snprintf(buf, size,
-                               "{ \"rule\": { \"family\" : \"%s\", \"table\" : \"%s\", "
-                               "\"chain\"  : \"%s\", \"handle\" : %llu,",
-                               nft_family2str(r->family), r->table, r->chain,
-                               (unsigned long long)r->handle);
+                      "{ \"rule\": { \"family\" : \"%s\", \"table\" : \"%s\", "
+                      "\"chain\"  : \"%s\", \"handle\" : %llu,",
+                      nft_family2str(r->family), r->table, r->chain,
+                      (unsigned long long)r->handle);
        SNPRINTF_BUFFER_SIZE(ret, size, len, offset);
 
        ret = snprintf(buf+offset, len, "\"flags\" : %u, ", r->rule_flags);
@@ -731,11 +731,11 @@ static int nft_rule_snprintf_json(char *buf, size_t size, struct nft_rule *r,
        }
 
        ret = snprintf(buf+offset, len, "\"expr\" : [");
-               SNPRINTF_BUFFER_SIZE(ret, size, len, offset);
+       SNPRINTF_BUFFER_SIZE(ret, size, len, offset);
 
        list_for_each_entry(expr, &r->expr_list, head) {
                ret = snprintf(buf+offset, len,
-                               " { \"type\" : \"%s\", ", expr->ops->name);
+                              " { \"type\" : \"%s\", ", expr->ops->name);
                SNPRINTF_BUFFER_SIZE(ret, size, len, offset);
 
                ret = expr->ops->snprintf(buf+offset, len, type, flags, expr);
@@ -746,7 +746,7 @@ static int nft_rule_snprintf_json(char *buf, size_t size, struct nft_rule *r,
 
        }
        ret = snprintf(buf+offset-1, len, "]}}");
-               SNPRINTF_BUFFER_SIZE(ret, size, len, offset);
+       SNPRINTF_BUFFER_SIZE(ret, size, len, offset);
 
        return offset;
 }