]> git.ipfire.org Git - thirdparty/libnftnl.git/commitdiff
rule, set_elem: remove trailing \n in userdata snprintf
authorPablo Neira Ayuso <pablo@netfilter.org>
Wed, 31 Aug 2022 14:52:51 +0000 (16:52 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 31 Aug 2022 14:54:46 +0000 (16:54 +0200)
212479ad2c92 ("rule, set_elem: fix printing of user data") uncovered
another an extra line break in the userdata printing, remove it.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/rule.c
src/set_elem.c

index a1a64bd2837d9966efbf406217c461c70ad98c3e..a52012b2177bbc84b41b3afef429cbdd6ca9983e 100644 (file)
@@ -628,7 +628,7 @@ static int nftnl_rule_snprintf_default(char *buf, size_t remain,
                        SNPRINTF_BUFFER_SIZE(ret, remain, offset);
                }
 
-               ret = snprintf(buf + offset, remain, " }\n");
+               ret = snprintf(buf + offset, remain, " }");
                SNPRINTF_BUFFER_SIZE(ret, remain, offset);
 
        }
index 1c8720dc7c57a3a8c503e7db24f1068dbcda55c8..884faff432a99e6167b1dfd9cd21ce673ce145c2 100644 (file)
@@ -747,7 +747,7 @@ int nftnl_set_elem_snprintf_default(char *buf, size_t remain,
                        SNPRINTF_BUFFER_SIZE(ret, remain, offset);
                }
 
-               ret = snprintf(buf + offset, remain, " }\n");
+               ret = snprintf(buf + offset, remain, " }");
                SNPRINTF_BUFFER_SIZE(ret, remain, offset);
        }