Fix typo in cmd line parsing
cover Fix typo in cmd line parsing
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
PATCH 1/1 Fix typo in loop.
This patch fixes a small typo in the command line parsing.
--- src/nfacct.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
src/nfacct.c +4 -4
@@ -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" );
Signature · 1 line
1.7.10.4
Quoted 6 lines · Eric Leblond
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.