diff options
author | Lorenz <12514511+RincewindsHat@users.noreply.github.com> | 2023-05-08 20:24:11 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-08 20:24:11 +0200 |
commit | 869cca59d857fde53b5a435cb8390f54058e8687 (patch) | |
tree | bc9aa773537691078fdac52222c0a8d34882629d | |
parent | 72d34baf718e12a88e978c69369b96baf63ef97a (diff) | |
parent | 6c78f0b5ea82a4bea71ae2024f27d3916175a7a2 (diff) | |
download | monitoring-plugins-869cca59d857fde53b5a435cb8390f54058e8687.tar.gz |
Merge pull request #1866 from RincewindsHat/compiler_warning_part_1
Compiler warning part 1
-rw-r--r-- | lib/utils_base.c | 8 | ||||
-rw-r--r-- | plugins-root/check_dhcp.c | 4 | ||||
-rw-r--r-- | plugins/check_curl.c | 5 | ||||
-rw-r--r-- | plugins/check_http.c | 1 | ||||
-rw-r--r-- | plugins/runcmd.c | 2 |
5 files changed, 8 insertions, 12 deletions
diff --git a/lib/utils_base.c b/lib/utils_base.c index eb1823bb..c458cf61 100644 --- a/lib/utils_base.c +++ b/lib/utils_base.c | |||
@@ -24,7 +24,7 @@ | |||
24 | * | 24 | * |
25 | *****************************************************************************/ | 25 | *****************************************************************************/ |
26 | 26 | ||
27 | #include "common.h" | 27 | #include "../plugins/common.h" |
28 | #include <stdarg.h> | 28 | #include <stdarg.h> |
29 | #include "utils_base.h" | 29 | #include "utils_base.h" |
30 | #include <ctype.h> | 30 | #include <ctype.h> |
@@ -319,18 +319,18 @@ char *np_extract_value(const char *varlist, const char *name, char sep) { | |||
319 | 319 | ||
320 | while (1) { | 320 | while (1) { |
321 | /* Strip any leading space */ | 321 | /* Strip any leading space */ |
322 | for (varlist; isspace(varlist[0]); varlist++); | 322 | for (; isspace(varlist[0]); varlist++); |
323 | 323 | ||
324 | if (strncmp(name, varlist, strlen(name)) == 0) { | 324 | if (strncmp(name, varlist, strlen(name)) == 0) { |
325 | varlist += strlen(name); | 325 | varlist += strlen(name); |
326 | /* strip trailing spaces */ | 326 | /* strip trailing spaces */ |
327 | for (varlist; isspace(varlist[0]); varlist++); | 327 | for (; isspace(varlist[0]); varlist++); |
328 | 328 | ||
329 | if (varlist[0] == '=') { | 329 | if (varlist[0] == '=') { |
330 | /* We matched the key, go past the = sign */ | 330 | /* We matched the key, go past the = sign */ |
331 | varlist++; | 331 | varlist++; |
332 | /* strip leading spaces */ | 332 | /* strip leading spaces */ |
333 | for (varlist; isspace(varlist[0]); varlist++); | 333 | for (; isspace(varlist[0]); varlist++); |
334 | 334 | ||
335 | if (tmp = index(varlist, sep)) { | 335 | if (tmp = index(varlist, sep)) { |
336 | /* Value is delimited by a comma */ | 336 | /* Value is delimited by a comma */ |
diff --git a/plugins-root/check_dhcp.c b/plugins-root/check_dhcp.c index ad673237..147db6b3 100644 --- a/plugins-root/check_dhcp.c +++ b/plugins-root/check_dhcp.c | |||
@@ -470,10 +470,6 @@ int send_dhcp_discover(int sock){ | |||
470 | packet_xid=random(); | 470 | packet_xid=random(); |
471 | discover_packet.xid=htonl(packet_xid); | 471 | discover_packet.xid=htonl(packet_xid); |
472 | 472 | ||
473 | /**** WHAT THE HECK IS UP WITH THIS?!? IF I DON'T MAKE THIS CALL, ONLY ONE SERVER RESPONSE IS PROCESSED!!!! ****/ | ||
474 | /* downright bizzarre... */ | ||
475 | ntohl(discover_packet.xid); | ||
476 | |||
477 | /*discover_packet.secs=htons(65535);*/ | 473 | /*discover_packet.secs=htons(65535);*/ |
478 | discover_packet.secs=0xFF; | 474 | discover_packet.secs=0xFF; |
479 | 475 | ||
diff --git a/plugins/check_curl.c b/plugins/check_curl.c index be5740d7..100a97aa 100644 --- a/plugins/check_curl.c +++ b/plugins/check_curl.c | |||
@@ -2217,11 +2217,10 @@ curlhelp_parse_statusline (const char *buf, curlhelp_statusline *status_line) | |||
2217 | if( strchr( p, '.' ) != NULL ) { | 2217 | if( strchr( p, '.' ) != NULL ) { |
2218 | 2218 | ||
2219 | /* HTTP 1.x case */ | 2219 | /* HTTP 1.x case */ |
2220 | char *ppp; | 2220 | strtok( p, "." ); |
2221 | ppp = strtok( p, "." ); | ||
2222 | status_line->http_major = (int)strtol( p, &pp, 10 ); | 2221 | status_line->http_major = (int)strtol( p, &pp, 10 ); |
2223 | if( *pp != '\0' ) { free( first_line_buf ); return -1; } | 2222 | if( *pp != '\0' ) { free( first_line_buf ); return -1; } |
2224 | ppp = strtok( NULL, " " ); | 2223 | strtok( NULL, " " ); |
2225 | status_line->http_minor = (int)strtol( p, &pp, 10 ); | 2224 | status_line->http_minor = (int)strtol( p, &pp, 10 ); |
2226 | if( *pp != '\0' ) { free( first_line_buf ); return -1; } | 2225 | if( *pp != '\0' ) { free( first_line_buf ); return -1; } |
2227 | p += 4; /* 1.x SP */ | 2226 | p += 4; /* 1.x SP */ |
diff --git a/plugins/check_http.c b/plugins/check_http.c index 8c03bc8b..6956a726 100644 --- a/plugins/check_http.c +++ b/plugins/check_http.c | |||
@@ -1391,7 +1391,6 @@ char *unchunk_content(const char *content) { | |||
1391 | // https://en.wikipedia.org/wiki/Chunked_transfer_encoding | 1391 | // https://en.wikipedia.org/wiki/Chunked_transfer_encoding |
1392 | // https://www.rfc-editor.org/rfc/rfc7230#section-4.1 | 1392 | // https://www.rfc-editor.org/rfc/rfc7230#section-4.1 |
1393 | char *result = NULL; | 1393 | char *result = NULL; |
1394 | size_t content_length = strlen(content); | ||
1395 | char *start_of_chunk; | 1394 | char *start_of_chunk; |
1396 | char* end_of_chunk; | 1395 | char* end_of_chunk; |
1397 | long size_of_chunk; | 1396 | long size_of_chunk; |
diff --git a/plugins/runcmd.c b/plugins/runcmd.c index 1bd2ca1f..c1d675d0 100644 --- a/plugins/runcmd.c +++ b/plugins/runcmd.c | |||
@@ -44,6 +44,8 @@ | |||
44 | # include <sys/wait.h> | 44 | # include <sys/wait.h> |
45 | #endif | 45 | #endif |
46 | 46 | ||
47 | #include "./utils.h" | ||
48 | |||
47 | /** macros **/ | 49 | /** macros **/ |
48 | #ifndef WEXITSTATUS | 50 | #ifndef WEXITSTATUS |
49 | # define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) | 51 | # define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) |