diff options
author | RincewindsHat <12514511+RincewindsHat@users.noreply.github.com> | 2024-10-31 02:33:10 (GMT) |
---|---|---|
committer | RincewindsHat <12514511+RincewindsHat@users.noreply.github.com> | 2024-10-31 02:33:10 (GMT) |
commit | 4f34506c81484673bf3623d1c3a8100dc1761e8c (patch) | |
tree | 0f448704cc6bd27e005365581a7420cc5dde9f43 | |
parent | 702dc596a4a6ed124751c55cbd5c62f96ae8a157 (diff) | |
download | monitoring-plugins-4f34506c81484673bf3623d1c3a8100dc1761e8c.tar.gz |
check_dns: Linter fixes
-rw-r--r-- | plugins/check_dns.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/plugins/check_dns.c b/plugins/check_dns.c index 911853b..e5ca581 100644 --- a/plugins/check_dns.c +++ b/plugins/check_dns.c | |||
@@ -39,11 +39,11 @@ const char *email = "devel@monitoring-plugins.org"; | |||
39 | #include "netutils.h" | 39 | #include "netutils.h" |
40 | #include "runcmd.h" | 40 | #include "runcmd.h" |
41 | 41 | ||
42 | static int process_arguments(int, char **); | 42 | static int process_arguments(int /*argc*/, char ** /*argv*/); |
43 | static int validate_arguments(void); | 43 | static int validate_arguments(void); |
44 | static int error_scan(char *, bool *); | 44 | static int error_scan(char * /*input_buffer*/, bool *); |
45 | static bool ip_match_cidr(const char *, const char *); | 45 | static bool ip_match_cidr(const char * /*addr*/, const char * /*cidr_ro*/); |
46 | static unsigned long ip2long(const char *); | 46 | static unsigned long ip2long(const char * /*src*/); |
47 | static void print_help(void); | 47 | static void print_help(void); |
48 | void print_usage(void); | 48 | void print_usage(void); |
49 | 49 | ||
@@ -81,7 +81,8 @@ int main(int argc, char **argv) { | |||
81 | long microsec; | 81 | long microsec; |
82 | struct timeval tv; | 82 | struct timeval tv; |
83 | bool parse_address = false; /* This flag scans for Address: but only after Name: */ | 83 | bool parse_address = false; /* This flag scans for Address: but only after Name: */ |
84 | output chld_out, chld_err; | 84 | output chld_out; |
85 | output chld_err; | ||
85 | bool is_nxdomain = false; | 86 | bool is_nxdomain = false; |
86 | 87 | ||
87 | setlocale(LC_ALL, ""); | 88 | setlocale(LC_ALL, ""); |
@@ -204,7 +205,8 @@ int main(int argc, char **argv) { | |||
204 | } | 205 | } |
205 | 206 | ||
206 | if (addresses) { | 207 | if (addresses) { |
207 | int i, slen; | 208 | int i; |
209 | int slen; | ||
208 | char *adrp; | 210 | char *adrp; |
209 | qsort(addresses, n_addresses, sizeof(*addresses), qstrcmp); | 211 | qsort(addresses, n_addresses, sizeof(*addresses), qstrcmp); |
210 | for (i = 0, slen = 1; i < n_addresses; i++) { | 212 | for (i = 0, slen = 1; i < n_addresses; i++) { |
@@ -303,7 +305,9 @@ int main(int argc, char **argv) { | |||
303 | } | 305 | } |
304 | 306 | ||
305 | bool ip_match_cidr(const char *addr, const char *cidr_ro) { | 307 | bool ip_match_cidr(const char *addr, const char *cidr_ro) { |
306 | char *subnet, *mask_c, *cidr = strdup(cidr_ro); | 308 | char *subnet; |
309 | char *mask_c; | ||
310 | char *cidr = strdup(cidr_ro); | ||
307 | int mask; | 311 | int mask; |
308 | subnet = strtok(cidr, "/"); | 312 | subnet = strtok(cidr, "/"); |
309 | mask_c = strtok(NULL, "\0"); | 313 | mask_c = strtok(NULL, "\0"); |
@@ -505,7 +509,7 @@ int process_arguments(int argc, char **argv) { | |||
505 | return validate_arguments(); | 509 | return validate_arguments(); |
506 | } | 510 | } |
507 | 511 | ||
508 | int validate_arguments() { | 512 | int validate_arguments(void) { |
509 | if (query_address[0] == 0) { | 513 | if (query_address[0] == 0) { |
510 | printf("missing --host argument\n"); | 514 | printf("missing --host argument\n"); |
511 | return ERROR; | 515 | return ERROR; |