From 750fbea1a1b58d383707ce121e1140dbc5a8ee58 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Wed, 4 Oct 2017 13:19:10 +0200 Subject: expr: no need to nul-terminate buffer from expression ->snprintf indirection ->snprintf() is always called via nftnl_expr_snprintf() wrapper, which is already dealing with this corner case for us. Signed-off-by: Pablo Neira Ayuso --- src/expr/match.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'src/expr/match.c') diff --git a/src/expr/match.c b/src/expr/match.c index af659b3..dd09e1e 100644 --- a/src/expr/match.c +++ b/src/expr/match.c @@ -200,9 +200,6 @@ nftnl_expr_match_snprintf(char *buf, size_t len, uint32_t type, { struct nftnl_expr_match *match = nftnl_expr_data(e); - if (len) - buf[0] = '\0'; - switch (type) { case NFTNL_OUTPUT_DEFAULT: return snprintf(buf, len, "name %s rev %u ", -- cgit v1.2.3