[Nagiosplug-checkins] nagiosplug/plugins-root check_dhcp.c, 1.7, 1.8

Holger Weiss hweiss at users.sourceforge.net
Sun Jan 28 22:46:43 CET 2007


Update of /cvsroot/nagiosplug/nagiosplug/plugins-root
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv3332/plugins-root

Modified Files:
	check_dhcp.c 
Log Message:
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.


Index: check_dhcp.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins-root/check_dhcp.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- check_dhcp.c	27 Jan 2007 16:37:34 -0000	1.7
+++ check_dhcp.c	28 Jan 2007 21:46:41 -0000	1.8
@@ -1091,7 +1091,7 @@
 			break;
 
 		case '?': /* help */
-			usage2 (_("Unknown argument"), optarg);
+			usage5 ();
 			break;
 
 		default:





More information about the Commits mailing list