diff options
author | Ton Voon <tonvoon@users.sourceforge.net> | 2003-02-11 00:47:47 (GMT) |
---|---|---|
committer | Ton Voon <tonvoon@users.sourceforge.net> | 2003-02-11 00:47:47 (GMT) |
commit | f2f3481179c0b11430cbdb2459e21e51ff265661 (patch) | |
tree | 3b9a66f0255ecc4322d631834b03d61ce4956bde | |
parent | cbdef12b91c1aa06d703fe5fdf7b053e0ed41c93 (diff) | |
download | monitoring-plugins-f2f3481179c0b11430cbdb2459e21e51ff265661.tar.gz |
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
-rw-r--r-- | plugins/check_mysql.c | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/plugins/check_mysql.c b/plugins/check_mysql.c index f806a27..18324c8 100644 --- a/plugins/check_mysql.c +++ b/plugins/check_mysql.c | |||
@@ -189,25 +189,26 @@ process_arguments (int argc, char **argv) | |||
189 | 189 | ||
190 | c = optind; | 190 | c = optind; |
191 | 191 | ||
192 | if (strlen(db_host) == 0 && argc > c) | 192 | while ( argc > c ) { |
193 | if (is_host (argv[c])) { | ||
194 | db_host = argv[c++]; | ||
195 | } | ||
196 | else { | ||
197 | usage ("Invalid host name"); | ||
198 | } | ||
199 | |||
200 | if (strlen(db_user) == 0 && argc > c) | ||
201 | db_user = argv[c++]; | ||
202 | |||
203 | if (strlen(db_pass) == 0 && argc > c) | ||
204 | db_pass = argv[c++]; | ||
205 | |||
206 | if (strlen(db) == 0 && argc > c) | ||
207 | db = argv[c++]; | ||
208 | 193 | ||
209 | if (is_intnonneg (argv[c]) && argc > c) | 194 | if (strlen(db_host) == 0) |
210 | db_port = atoi (argv[c++]); | 195 | if (is_host (argv[c])) { |
196 | db_host = argv[c++]; | ||
197 | } | ||
198 | else { | ||
199 | usage ("Invalid host name"); | ||
200 | } | ||
201 | else if (strlen(db_user) == 0) | ||
202 | db_user = argv[c++]; | ||
203 | else if (strlen(db_pass) == 0) | ||
204 | db_pass = argv[c++]; | ||
205 | else if (strlen(db) == 0) | ||
206 | db = argv[c++]; | ||
207 | else if (is_intnonneg (argv[c])) | ||
208 | db_port = atoi (argv[c++]); | ||
209 | else | ||
210 | break; | ||
211 | } | ||
211 | 212 | ||
212 | return validate_arguments (); | 213 | return validate_arguments (); |
213 | } | 214 | } |