summaryrefslogtreecommitdiffstats
path: root/src/object.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/object.c')
-rw-r--r--src/object.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/object.c b/src/object.c
index 4eb4d35..46e208b 100644
--- a/src/object.c
+++ b/src/object.c
@@ -411,18 +411,11 @@ static int nftnl_obj_cmd_snprintf(char *buf, size_t remain,
{
int ret, offset = 0;
- switch (type) {
- case NFTNL_OUTPUT_DEFAULT:
- ret = nftnl_obj_snprintf_dflt(buf + offset, remain, obj, type,
- flags);
- break;
- case NFTNL_OUTPUT_JSON:
- case NFTNL_OUTPUT_XML:
- default:
+ if (type != NFTNL_OUTPUT_DEFAULT)
return -1;
- }
- SNPRINTF_BUFFER_SIZE(ret, remain, offset);
+ ret = nftnl_obj_snprintf_dflt(buf + offset, remain, obj, type, flags);
+ SNPRINTF_BUFFER_SIZE(ret, remain, offset);
return offset;
}