summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Weiss <hweiss@users.sourceforge.net>2007-03-29 17:58:28 (GMT)
committerHolger Weiss <hweiss@users.sourceforge.net>2007-03-29 17:58:28 (GMT)
commitb809d23c81021ab39000196af87e1dcac4ac291d (patch)
tree23cfd168e4f361d664b76dec9cde5fbcf9abbab1
parent2a01e28165b321b6d698b9e1868acce76925b9f5 (diff)
downloadmonitoring-plugins-b809d23c81021ab39000196af87e1dcac4ac291d.tar.gz
Fix argument processing (Felix Frank - 1690697)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1655 f882894a-f735-0410-b71e-b25c423dba1c
-rw-r--r--THANKS.in1
-rw-r--r--plugins/check_mysql.c10
2 files changed, 6 insertions, 5 deletions
diff --git a/THANKS.in b/THANKS.in
index 6d674bc..da6dd21 100644
--- a/THANKS.in
+++ b/THANKS.in
@@ -214,3 +214,4 @@ Enrico Scholz
214Marlo Bell 214Marlo Bell
215Stefan Meier 215Stefan Meier
216Mark Favas 216Mark Favas
217Felix Frank
diff --git a/plugins/check_mysql.c b/plugins/check_mysql.c
index 573ec96..dc8c491 100644
--- a/plugins/check_mysql.c
+++ b/plugins/check_mysql.c
@@ -318,18 +318,18 @@ process_arguments (int argc, char **argv)
318 318
319 while ( argc > c ) { 319 while ( argc > c ) {
320 320
321 if (strlen(db_host) == 0) 321 if (db_host == NULL)
322 if (is_host (argv[c])) { 322 if (is_host (argv[c])) {
323 db_host = argv[c++]; 323 db_host = argv[c++];
324 } 324 }
325 else { 325 else {
326 usage2 (_("Invalid hostname/address"), optarg); 326 usage2 (_("Invalid hostname/address"), argv[c]);
327 } 327 }
328 else if (strlen(db_user) == 0) 328 else if (db_user == NULL)
329 db_user = argv[c++]; 329 db_user = argv[c++];
330 else if (strlen(db_pass) == 0) 330 else if (db_pass == NULL)
331 db_pass = argv[c++]; 331 db_pass = argv[c++];
332 else if (strlen(db) == 0) 332 else if (db == NULL)
333 db = argv[c++]; 333 db = argv[c++];
334 else if (is_intnonneg (argv[c])) 334 else if (is_intnonneg (argv[c]))
335 db_port = atoi (argv[c++]); 335 db_port = atoi (argv[c++]);