All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hannes Eder <heder@google.com>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: netfilter@vger.kernel.org, netfilter-devel@vger.kernel.org
Subject: Re: [PATCH] conntrack: do not print garbage after the usage message
Date: Wed, 30 Sep 2009 16:00:42 +0200	[thread overview]
Message-ID: <4AC3648A.2090506@google.com> (raw)
In-Reply-To: <4AC35CA4.6090303@google.com>

Hannes Eder wrote:
> [cc: -netdev, +netfilter]
> 
> Hannes Eder wrote:
>> diff --git a/src/conntrack.c b/src/conntrack.c
>> index 42b5133..5ca68d1 100644
>> --- a/src/conntrack.c
>> +++ b/src/conntrack.c
>> @@ -1493,7 +1493,7 @@ int main(int argc, char *argv[])
>>  
>>      free_options();
>>  
>> -    if (exit_msg[cmd][0]) {
>> +    if (cmd != CT_NONE && exit_msg[cmd][0]) {

Ups, this does not work, in case of

# conntrack -L conntrack
...

the final:

conntrack v0.9.13 (conntrack-tools): XXX flow entries have been shown.

Is missing, the following should do the trick.  Sorry for the noise.

From: Hannes Eder <heder@google.com>

When 'conntrack' is called with no arguments then garbage is printed
after the usage message.  This patch fixes this.

Signed-off-by: Hannes Eder <heder@google.com>
---

diff --git a/src/conntrack.c b/src/conntrack.c
index 5ca68d1..0053a28 100644
--- a/src/conntrack.c
+++ b/src/conntrack.c
@@ -1493,7 +1493,7 @@ int main(int argc, char *argv[])

         free_options();

-       if (cmd != CT_NONE && exit_msg[cmd][0]) {
+       if (command && exit_msg[cmd][0]) {
                 fprintf(stderr, "%s v%s (conntrack-tools): ",PROGNAME,VERSION);
                 fprintf(stderr, exit_msg[cmd], counter);
                 if (counter == 0 && !(command & (CT_LIST | EXP_LIST)))



      reply	other threads:[~2009-09-30 14:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-30 13:02 [PATCH] conntrack: do not print garbage after the usage message Hannes Eder
2009-09-30 13:27 ` Hannes Eder
2009-09-30 14:00   ` Hannes Eder [this message]

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=4AC3648A.2090506@google.com \
    --to=heder@google.com \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=netfilter@vger.kernel.org \
    --cc=pablo@netfilter.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.