summaryrefslogtreecommitdiffstats
path: root/plugins/check_tcp.c
diff options
context:
space:
mode:
authorHolger Weiss <hweiss@users.sourceforge.net>2007-01-28 21:46:41 (GMT)
committerHolger Weiss <hweiss@users.sourceforge.net>2007-01-28 21:46:41 (GMT)
commitfd329a1e91cccc8845923af572890ac42b76afc1 (patch)
tree1c58ed9155320c49910689c4a762184fa6d2c8db /plugins/check_tcp.c
parent381715a2bd1f9163b791dc2a12ef8c60bac2c19a (diff)
downloadmonitoring-plugins-fd329a1e91cccc8845923af572890ac42b76afc1.tar.gz
Don't try to print `optarg' (which will be a NULL pointer) if an unknown
command line option was used, as this leads to a segfault on some systems. The unknown option will be printed by getopt(3) anyway. So, simply call print_usage() and exit UNKNOWN via the new usage5() instead. git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1590 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins/check_tcp.c')
-rw-r--r--plugins/check_tcp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/check_tcp.c b/plugins/check_tcp.c
index faa3ced..7e1bd38 100644
--- a/plugins/check_tcp.c
+++ b/plugins/check_tcp.c
@@ -443,7 +443,7 @@ process_arguments (int argc, char **argv)
443 443
444 switch (c) { 444 switch (c) {
445 case '?': /* print short usage statement if args not parsable */ 445 case '?': /* print short usage statement if args not parsable */
446 usage2 (_("Unknown argument"), optarg); 446 usage5 ();
447 case 'h': /* help */ 447 case 'h': /* help */
448 print_help (); 448 print_help ();
449 exit (STATE_OK); 449 exit (STATE_OK);