summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3c9fc74)
raw | patch | inline | side by side (parent: 3c9fc74)
author | Karl DeBisschop <kdebisschop@users.sourceforge.net> | |
Wed, 5 Feb 2003 05:58:35 +0000 (05:58 +0000) | ||
committer | Karl DeBisschop <kdebisschop@users.sourceforge.net> | |
Wed, 5 Feb 2003 05:58:35 +0000 (05:58 +0000) |
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@290 f882894a-f735-0410-b71e-b25c423dba1c
plugins/check_dns.c | patch | blob | history |
diff --git a/plugins/check_dns.c b/plugins/check_dns.c
index 3462701a07f6ba9a4caf73b492042cfc69642683..c0ea298278049237e8f86fe9a4690851e2d86052 100644 (file)
--- a/plugins/check_dns.c
+++ b/plugins/check_dns.c
}
c = optind;
- if (query_address[0] == 0) {
- if (is_host (argv[c]) == FALSE) {
+ if (strlen(query_address)==0 && c<argc) {
+ if (is_host(argv[c])==FALSE) {
printf ("Invalid name/address: %s\n\n", argv[c]);
return ERROR;
}
- if (strlen (argv[c]) >= ADDRESS_LENGTH)
+ if (strlen(argv[c])>=ADDRESS_LENGTH)
terminate (STATE_UNKNOWN, "Input buffer overflow\n");
strcpy (query_address, argv[c++]);
}
- if (dns_server[0] == 0) {
- if (is_host (argv[c]) == FALSE) {
+ if (strlen(dns_server)==0 && c<argc) {
+ if (is_host(argv[c]) == FALSE) {
printf ("Invalid name/address: %s\n\n", argv[c]);
return ERROR;
}
- if (strlen (argv[c]) >= ADDRESS_LENGTH)
+ if (strlen(argv[c]) >= ADDRESS_LENGTH)
terminate (STATE_UNKNOWN, "Input buffer overflow\n");
strcpy (dns_server, argv[c++]);
}