summaryrefslogtreecommitdiffstats
path: root/src/expr/hash.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/expr/hash.c')
-rw-r--r--src/expr/hash.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/expr/hash.c b/src/expr/hash.c
index fcc4fa5..066c790 100644
--- a/src/expr/hash.c
+++ b/src/expr/hash.c
@@ -288,6 +288,9 @@ static int
nftnl_expr_hash_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_hash_snprintf_default(buf, len, e);