mirror of
https://github.com/monitoring-plugins/monitoring-plugins.git
synced 2026-06-08 16:26:23 -04:00
Patch by Dave Viner for seg fault on RH 7.3 (655903)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@316 f882894a-f735-0410-b71e-b25c423dba1c
This commit is contained in:
parent
cbdef12b91
commit
f2f3481179
1 changed files with 19 additions and 18 deletions
|
|
@ -189,25 +189,26 @@ process_arguments (int argc, char **argv)
|
|||
|
||||
c = optind;
|
||||
|
||||
if (strlen(db_host) == 0 && argc > c)
|
||||
if (is_host (argv[c])) {
|
||||
db_host = argv[c++];
|
||||
}
|
||||
else {
|
||||
usage ("Invalid host name");
|
||||
}
|
||||
while ( argc > c ) {
|
||||
|
||||
if (strlen(db_user) == 0 && argc > c)
|
||||
db_user = argv[c++];
|
||||
|
||||
if (strlen(db_pass) == 0 && argc > c)
|
||||
db_pass = argv[c++];
|
||||
|
||||
if (strlen(db) == 0 && argc > c)
|
||||
db = argv[c++];
|
||||
|
||||
if (is_intnonneg (argv[c]) && argc > c)
|
||||
db_port = atoi (argv[c++]);
|
||||
if (strlen(db_host) == 0)
|
||||
if (is_host (argv[c])) {
|
||||
db_host = argv[c++];
|
||||
}
|
||||
else {
|
||||
usage ("Invalid host name");
|
||||
}
|
||||
else if (strlen(db_user) == 0)
|
||||
db_user = argv[c++];
|
||||
else if (strlen(db_pass) == 0)
|
||||
db_pass = argv[c++];
|
||||
else if (strlen(db) == 0)
|
||||
db = argv[c++];
|
||||
else if (is_intnonneg (argv[c]))
|
||||
db_port = atoi (argv[c++]);
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
return validate_arguments ();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue