summaryrefslogtreecommitdiffstats
path: root/src/expr/counter.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/expr/counter.c')
-rw-r--r--src/expr/counter.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/expr/counter.c b/src/expr/counter.c
index 21901e8..5c196d4 100644
--- a/src/expr/counter.c
+++ b/src/expr/counter.c
@@ -164,6 +164,9 @@ static int nftnl_expr_counter_snprintf(char *buf, size_t len, uint32_t type,
uint32_t flags,
const struct nftnl_expr *e)
{
+ if (len)
+ buf[0] = '\0';
+
switch (type) {
case NFTNL_OUTPUT_DEFAULT:
return nftnl_expr_counter_snprintf_default(buf, len, e);