conntrack: do not print garbage after the usage message
Subsystems (3)
PATCH 1/1 conntrack: do not print garbage after the usage message
When 'conntrack' is called with no arguments then garbage is printed after the usage message. This patch fixes this.
Signed-off-by Hannes Eder <[email protected]>
src/conntrack.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
src/conntrack.c +1 -1
@@ -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 )))
[cc: -netdev, +netfilter]
Quoted 22 lines · Hannes Eder
When 'conntrack' is called with no arguments then garbage is printed after the usage message. This patch fixes this.
Signed-off-by Hannes Eder <[email protected]>src/conntrack.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)src/conntrack.c +1
-1@@ -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 )))
Quoted 9 lines · Hannes Eder
[cc: -netdev, +netfilter]
Quoted 6 lines · Hannes Eder
src/conntrack.c +0
-0@@ -1493,7 +1493,7 @@ int main(int argc, char *argv[])
Quoted 4 lines
src/conntrack.c int main(int argc, char *argv[]) · line 1496
Quoted 4 lines
src/conntrack.c +1
-1free_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 <[email protected]>
When 'conntrack' is called with no arguments then garbage is printed after the usage message. This patch fixes this.
Signed-off-by Hannes Eder <[email protected]>
---
src/conntrack.c +1 -1
@@ -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 )))