summaryrefslogtreecommitdiffstats
path: root/src/expr/rt.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/expr/rt.c')
-rw-r--r--src/expr/rt.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/expr/rt.c b/src/expr/rt.c
index 62c01a0..10cb1e2 100644
--- a/src/expr/rt.c
+++ b/src/expr/rt.c
@@ -203,6 +203,9 @@ static int
nftnl_expr_rt_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_rt_snprintf_default(buf, len, e);