summaryrefslogtreecommitdiffstats
path: root/src/expr
diff options
context:
space:
mode:
Diffstat (limited to 'src/expr')
-rw-r--r--src/expr/ct.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/expr/ct.c b/src/expr/ct.c
index 2c28beb..caabdbc 100644
--- a/src/expr/ct.c
+++ b/src/expr/ct.c
@@ -358,9 +358,10 @@ nft_expr_ct_snprintf_json(char *buf, size_t size, struct nft_rule_expr *e)
}
/* Remove the last separator characther */
- buf[offset-1] = '\0';
+ if (offset > 0)
+ offset--;
- return offset-1;
+ return offset;
}
static int