From: Alvaro Neira <alvaroneay@gmail.com>
To: netfilter-devel@vger.kernel.org
Cc: eric@regit.org
Subject: [libnftables PATCH v2 1/2] rule: json: Fixed wrong offset return
Date: Tue, 24 Sep 2013 14:54:10 +0200 [thread overview]
Message-ID: <20130924125410.18650.33470.stgit@Ph0enix> (raw)
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
Signed-off-by: Alvaro Neira Ayuso <alvaroneay@gmail.com>
---
src/rule.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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,
--
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
next reply other threads:[~2013-09-24 12:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-24 12:54 Alvaro Neira [this message]
2013-09-24 12:54 ` [libnftables PATCH v2 2/2] This patch adds a ruleset object API to libnftables Alvaro Neira
2013-09-25 20:38 ` Pablo Neira Ayuso
2013-09-25 21:11 ` Arturo Borrero Gonzalez
2013-09-25 20:11 ` [libnftables PATCH v2 1/2] rule: json: Fixed wrong offset return Pablo Neira Ayuso
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130924125410.18650.33470.stgit@Ph0enix \
--to=alvaroneay@gmail.com \
--cc=eric@regit.org \
--cc=netfilter-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).