summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarl DeBisschop <kdebisschop@users.sourceforge.net>2003-02-18 22:24:35 (GMT)
committerKarl DeBisschop <kdebisschop@users.sourceforge.net>2003-02-18 22:24:35 (GMT)
commitb0d5270f0a2e688e6ba44dde8011dfae63bbf754 (patch)
tree057ed05413f851679214980d7641f96f89d25b10
parent2bd8a33c8d801fba8df8eb96c106a67c110126e6 (diff)
downloadmonitoring-plugins-b0d5270f0a2e688e6ba44dde8011dfae63bbf754.tar.gz
never exited getopt loop
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@342 f882894a-f735-0410-b71e-b25c423dba1c
-rw-r--r--plugins/check_udp.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/plugins/check_udp.c b/plugins/check_udp.c
index 8626f8c..4074d94 100644
--- a/plugins/check_udp.c
+++ b/plugins/check_udp.c
@@ -161,6 +161,9 @@ process_arguments (int argc, char **argv)
161 c = getopt (argc, argv, "+hVvH:e:s:c:w:t:p:"); 161 c = getopt (argc, argv, "+hVvH:e:s:c:w:t:p:");
162#endif 162#endif
163 163
164 if (c == -1 || c == EOF || c == 1)
165 break;
166
164 switch (c) { 167 switch (c) {
165 case '?': /* print short usage statement if args not parsable */ 168 case '?': /* print short usage statement if args not parsable */
166 printf ("%s: Unknown argument: %s\n\n", progname, optarg); 169 printf ("%s: Unknown argument: %s\n\n", progname, optarg);
@@ -212,7 +215,7 @@ process_arguments (int argc, char **argv)
212 } 215 }
213 216
214 c = optind; 217 c = optind;
215 if (server_address == NULL && argv[c]) { 218 if (server_address == NULL && c < argc && argv[c]) {
216 if (is_host (argv[c]) == FALSE) 219 if (is_host (argv[c]) == FALSE)
217 usage ("Invalid host name/address\n"); 220 usage ("Invalid host name/address\n");
218 server_address = argv[c++]; 221 server_address = argv[c++];