[libnftnl PATCH] Partially revert "rule, set_elem: remove trailing \n in userdata snprintf"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This reverts the rule-facing part of commit
c759027a526ac09ce413dc88c308a4ed98b33416.

It can't be right: Rules without userdata are printed with a trailing
newline, so this commit made behaviour inconsistent.

Fixes: c759027a526ac ("rule, set_elem: remove trailing \n in userdata snprintf")
Signed-off-by: Phil Sutter <phil@xxxxxx>
---
 src/rule.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/rule.c b/src/rule.c
index 811d5a213f835..51d778d095317 100644
--- a/src/rule.c
+++ b/src/rule.c
@@ -601,7 +601,7 @@ static int nftnl_rule_snprintf_default(char *buf, size_t remain,
 			SNPRINTF_BUFFER_SIZE(ret, remain, offset);
 		}
 
-		ret = snprintf(buf + offset, remain, " }");
+		ret = snprintf(buf + offset, remain, " }\n");
 		SNPRINTF_BUFFER_SIZE(ret, remain, offset);
 
 	}
-- 
2.43.0





[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux