Message ID | 20130924125410.18650.33470.stgit@Ph0enix |
---|---|
State | Accepted |
Headers | show |
On Tue, Sep 24, 2013 at 02:54:10PM +0200, Alvaro Neira wrote: > From: Álvaro Neira Ayuso <alvaroneay@gmail.com> > > I have fixed the offset because when i try to print more of one rule, > the json output support only print one rule because this function return > a wrong offset value Mangled and applied a similar, but better solution for this. -- To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/src/rule.c b/src/rule.c index e744cf8..e593109 100644 --- a/src/rule.c +++ b/src/rule.c @@ -748,7 +748,7 @@ static int nft_rule_snprintf_json(char *buf, size_t size, struct nft_rule *r, ret = snprintf(buf+offset-1, len, "]}}"); SNPRINTF_BUFFER_SIZE(ret, size, len, offset); - return offset; + return offset-1; } static int nft_rule_snprintf_xml(char *buf, size_t size, struct nft_rule *r,