* [nfacct PATCH 0/1] Fix typo in cmd line parsing @ 2012-07-14 21:40 Eric Leblond 2012-07-14 21:40 ` [PATCH] Fix typo in loop Eric Leblond 2012-07-16 12:27 ` [nfacct PATCH 0/1] Fix typo in cmd line parsing Pablo Neira Ayuso 0 siblings, 2 replies; 3+ messages in thread From: Eric Leblond @ 2012-07-14 21:40 UTC (permalink / raw) To: Pablo Neira Ayuso; +Cc: netfilter-devel Hello, This patch fixes what looks like a typo in the command line parsing. I did not manage to find a good explanation to the current code and I thus decide to cool this little patch. BR, -- Eric ^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] Fix typo in loop. 2012-07-14 21:40 [nfacct PATCH 0/1] Fix typo in cmd line parsing Eric Leblond @ 2012-07-14 21:40 ` Eric Leblond 2012-07-16 12:27 ` [nfacct PATCH 0/1] Fix typo in cmd line parsing Pablo Neira Ayuso 1 sibling, 0 replies; 3+ messages in thread From: Eric Leblond @ 2012-07-14 21:40 UTC (permalink / raw) To: Pablo Neira Ayuso; +Cc: netfilter-devel, Eric Leblond This patch fixes a small typo in the command line parsing. --- src/nfacct.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/nfacct.c b/src/nfacct.c index a59366e..8407670 100644 --- a/src/nfacct.c +++ b/src/nfacct.c @@ -159,9 +159,9 @@ static int nfacct_cmd_list(int argc, char *argv[]) int ret, i; for (i=2; i<argc; i++) { - if (strncmp(argv[i], "reset", strlen(argv[2])) == 0) { + if (strncmp(argv[i], "reset", strlen(argv[i])) == 0) { zeroctr = true; - } else if (strncmp(argv[i], "xml", strlen(argv[2])) == 0) { + } else if (strncmp(argv[i], "xml", strlen(argv[i])) == 0) { xml = true; } else { nfacct_perror("unknown argument"); @@ -357,9 +357,9 @@ static int nfacct_cmd_get(int argc, char *argv[]) return -1; } for (i=3; i<argc; i++) { - if (strncmp(argv[i], "reset", strlen(argv[2])) == 0) { + if (strncmp(argv[i], "reset", strlen(argv[i])) == 0) { zeroctr = true; - } else if (strncmp(argv[i], "xml", strlen(argv[2])) == 0) { + } else if (strncmp(argv[i], "xml", strlen(argv[i])) == 0) { xml = true; } else { nfacct_perror("unknown argument"); -- 1.7.10.4 ^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [nfacct PATCH 0/1] Fix typo in cmd line parsing 2012-07-14 21:40 [nfacct PATCH 0/1] Fix typo in cmd line parsing Eric Leblond 2012-07-14 21:40 ` [PATCH] Fix typo in loop Eric Leblond @ 2012-07-16 12:27 ` Pablo Neira Ayuso 1 sibling, 0 replies; 3+ messages in thread From: Pablo Neira Ayuso @ 2012-07-16 12:27 UTC (permalink / raw) To: Eric Leblond; +Cc: netfilter-devel On Sat, Jul 14, 2012 at 11:40:31PM +0200, Eric Leblond wrote: > > Hello, > > This patch fixes what looks like a typo in the command line parsing. > I did not manage to find a good explanation to the current code and > I thus decide to cool this little patch. Applied, thanks Eric You've fixed: nfacct list xml reset that allows you to atomically get and reset counters while obtaining them in XML. ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-07-16 12:27 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2012-07-14 21:40 [nfacct PATCH 0/1] Fix typo in cmd line parsing Eric Leblond 2012-07-14 21:40 ` [PATCH] Fix typo in loop Eric Leblond 2012-07-16 12:27 ` [nfacct PATCH 0/1] Fix typo in cmd line parsing Pablo Neira Ayuso
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).