[Nagiosplug-checkins] nagiosplug/plugins check_mysql.c,1.34,1.35

Holger Weiss hweiss at users.sourceforge.net
Thu Mar 29 19:58:30 CEST 2007


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

Modified Files:
	check_mysql.c 
Log Message:
Fix argument processing (Felix Frank - 1690697)


Index: check_mysql.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_mysql.c,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -d -r1.34 -r1.35
--- check_mysql.c	28 Jan 2007 21:46:40 -0000	1.34
+++ check_mysql.c	29 Mar 2007 17:58:28 -0000	1.35
@@ -318,18 +318,18 @@
 
 	while ( argc > c ) {
 
-		if (strlen(db_host) == 0)
+		if (db_host == NULL)
 			if (is_host (argv[c])) {
 				db_host = argv[c++];
 			}
 			else {
-				usage2 (_("Invalid hostname/address"), optarg);
+				usage2 (_("Invalid hostname/address"), argv[c]);
 			}
-		else if (strlen(db_user) == 0)
+		else if (db_user == NULL)
 			db_user = argv[c++];
-		else if (strlen(db_pass) == 0)
+		else if (db_pass == NULL)
 			db_pass = argv[c++];
-		else if (strlen(db) == 0)
+		else if (db == NULL)
 			db = argv[c++];
 		else if (is_intnonneg (argv[c]))
 			db_port = atoi (argv[c++]);





More information about the Commits mailing list