summaryrefslogtreecommitdiffstats
path: root/src/expr/ct.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/expr/ct.c')
-rw-r--r--src/expr/ct.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/expr/ct.c b/src/expr/ct.c
index ccefa1b..bf18c7e 100644
--- a/src/expr/ct.c
+++ b/src/expr/ct.c
@@ -279,17 +279,17 @@ nft_expr_ct_snprintf_json(char *buf, size_t size, struct nft_rule_expr *e)
int ret, len = size, offset = 0;
struct nft_expr_ct *ct = nft_expr_data(e);
- ret = snprintf(buf, size, "\"dreg\" : %u", ct->dreg);
+ ret = snprintf(buf, len, "\"dreg\" : %u", ct->dreg);
SNPRINTF_BUFFER_SIZE(ret, size, len, offset);
if (e->flags & (1 << NFT_EXPR_CT_KEY)) {
- ret = snprintf(buf+offset, size, ", \"key\" : \"%s\"",
+ ret = snprintf(buf+offset, len, ", \"key\" : \"%s\"",
ctkey2str(ct->key));
SNPRINTF_BUFFER_SIZE(ret, size, len, offset);
}
if (e->flags & (1 << NFT_EXPR_CT_DIR)) {
- ret = snprintf(buf+offset, size, ", \"dir\" : %u", ct->dir);
+ ret = snprintf(buf+offset, len, ", \"dir\" : %u", ct->dir);
SNPRINTF_BUFFER_SIZE(ret, size, len, offset);
}