summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2bd8a33)
raw | patch | inline | side by side (parent: 2bd8a33)
author | Karl DeBisschop <kdebisschop@users.sourceforge.net> | |
Tue, 18 Feb 2003 22:24:35 +0000 (22:24 +0000) | ||
committer | Karl DeBisschop <kdebisschop@users.sourceforge.net> | |
Tue, 18 Feb 2003 22:24:35 +0000 (22:24 +0000) |
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@342 f882894a-f735-0410-b71e-b25c423dba1c
plugins/check_udp.c | patch | blob | history |
diff --git a/plugins/check_udp.c b/plugins/check_udp.c
index 8626f8c4816a81db8fa1469920345460cc8197cf..4074d948453f9628e3120337ec19945e3fb39c14 100644 (file)
--- a/plugins/check_udp.c
+++ b/plugins/check_udp.c
c = getopt (argc, argv, "+hVvH:e:s:c:w:t:p:");
#endif
+ if (c == -1 || c == EOF || c == 1)
+ break;
+
switch (c) {
case '?': /* print short usage statement if args not parsable */
printf ("%s: Unknown argument: %s\n\n", progname, optarg);
}
c = optind;
- if (server_address == NULL && argv[c]) {
+ if (server_address == NULL && c < argc && argv[c]) {
if (is_host (argv[c]) == FALSE)
usage ("Invalid host name/address\n");
server_address = argv[c++];