Patchwork conntrack: do not print garbage after the usage message

login
register
mail settings
Submitter Hannes Eder
Date Sept. 30, 2009, 1:02 p.m.
Message ID <20090930130142.16484.76529.stgit@jazzy.zrh.corp.google.com>
Download mbox | patch
Permalink /patch/34579/
State Not Applicable
Headers show

Comments

Hannes Eder - Sept. 30, 2009, 1:02 p.m.
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>

 src/conntrack.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

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]) {
 		fprintf(stderr, "%s v%s (conntrack-tools): ",PROGNAME,VERSION);
 		fprintf(stderr, exit_msg[cmd], counter);
 		if (counter == 0 && !(command & (CT_LIST | EXP_LIST)))