diff options
Diffstat (limited to 'src/obj/counter.c')
-rw-r--r-- | src/obj/counter.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/obj/counter.c b/src/obj/counter.c index beadc93..332bb2b 100644 --- a/src/obj/counter.c +++ b/src/obj/counter.c @@ -158,6 +158,9 @@ static int nftnl_obj_counter_snprintf(char *buf, size_t len, uint32_t type, uint32_t flags, const struct nftnl_obj *e) { + if (len) + buf[0] = '\0'; + switch (type) { case NFTNL_OUTPUT_DEFAULT: return nftnl_obj_counter_snprintf_default(buf, len, e); |