summaryrefslogtreecommitdiffstats
path: root/src/rule.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/rule.c')
-rw-r--r--src/rule.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/rule.c b/src/rule.c
index 811d5a2..c22918a 100644
--- a/src/rule.c
+++ b/src/rule.c
@@ -573,23 +573,21 @@ static int nftnl_rule_snprintf_default(char *buf, size_t remain,
sep = " ";
}
- ret = snprintf(buf + offset, remain, "\n");
- SNPRINTF_BUFFER_SIZE(ret, remain, offset);
-
list_for_each_entry(expr, &r->expr_list, head) {
- ret = snprintf(buf + offset, remain, " [ %s ", expr->ops->name);
+ ret = snprintf(buf + offset, remain,
+ "\n [ %s ", expr->ops->name);
SNPRINTF_BUFFER_SIZE(ret, remain, offset);
ret = nftnl_expr_snprintf(buf + offset, remain, expr,
type, flags);
SNPRINTF_BUFFER_SIZE(ret, remain, offset);
- ret = snprintf(buf + offset, remain, "]\n");
+ ret = snprintf(buf + offset, remain, "]");
SNPRINTF_BUFFER_SIZE(ret, remain, offset);
}
if (r->user.len) {
- ret = snprintf(buf + offset, remain, " userdata = { ");
+ ret = snprintf(buf + offset, remain, "\n userdata = { ");
SNPRINTF_BUFFER_SIZE(ret, remain, offset);
for (i = 0; i < r->user.len; i++) {