From 1568940b3ea871ffb29d9bf1990cfa0528712b8d Mon Sep 17 00:00:00 2001 From: RincewindsHat <12514511+RincewindsHat@users.noreply.github.com> Date: Sun, 5 Mar 2023 10:09:45 +0100 Subject: Implicit function declarations diff --git a/plugins/runcmd.c b/plugins/runcmd.c index 1bd2ca1..c1d675d 100644 --- a/plugins/runcmd.c +++ b/plugins/runcmd.c @@ -44,6 +44,8 @@ # include #endif +#include "./utils.h" + /** macros **/ #ifndef WEXITSTATUS # define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) -- cgit v0.10-9-g596f From cee364f219ed73c75a4c4bfb5ac148b8a721780c Mon Sep 17 00:00:00 2001 From: RincewindsHat <12514511+RincewindsHat@users.noreply.github.com> Date: Sun, 5 Mar 2023 15:50:48 +0100 Subject: Remove unused variable from check_http diff --git a/plugins/check_http.c b/plugins/check_http.c index 8c03bc8..6956a72 100644 --- a/plugins/check_http.c +++ b/plugins/check_http.c @@ -1391,7 +1391,6 @@ char *unchunk_content(const char *content) { // https://en.wikipedia.org/wiki/Chunked_transfer_encoding // https://www.rfc-editor.org/rfc/rfc7230#section-4.1 char *result = NULL; - size_t content_length = strlen(content); char *start_of_chunk; char* end_of_chunk; long size_of_chunk; -- cgit v0.10-9-g596f From 6c78f0b5ea82a4bea71ae2024f27d3916175a7a2 Mon Sep 17 00:00:00 2001 From: RincewindsHat <12514511+RincewindsHat@users.noreply.github.com> Date: Sun, 12 Mar 2023 14:16:35 +0100 Subject: Fixes for -Wunused * lib/utils_base.c * plugins/check_curl.c * plugins-root/check_dhcp.c Removed a line which theoretically can not do anything, but there was comment which indicated something else. Still trying this though. diff --git a/lib/utils_base.c b/lib/utils_base.c index eb1823b..c458cf6 100644 --- a/lib/utils_base.c +++ b/lib/utils_base.c @@ -24,7 +24,7 @@ * *****************************************************************************/ -#include "common.h" +#include "../plugins/common.h" #include #include "utils_base.h" #include @@ -319,18 +319,18 @@ char *np_extract_value(const char *varlist, const char *name, char sep) { while (1) { /* Strip any leading space */ - for (varlist; isspace(varlist[0]); varlist++); + for (; isspace(varlist[0]); varlist++); if (strncmp(name, varlist, strlen(name)) == 0) { varlist += strlen(name); /* strip trailing spaces */ - for (varlist; isspace(varlist[0]); varlist++); + for (; isspace(varlist[0]); varlist++); if (varlist[0] == '=') { /* We matched the key, go past the = sign */ varlist++; /* strip leading spaces */ - for (varlist; isspace(varlist[0]); varlist++); + for (; isspace(varlist[0]); varlist++); if (tmp = index(varlist, sep)) { /* Value is delimited by a comma */ diff --git a/plugins-root/check_dhcp.c b/plugins-root/check_dhcp.c index ad67323..147db6b 100644 --- a/plugins-root/check_dhcp.c +++ b/plugins-root/check_dhcp.c @@ -470,10 +470,6 @@ int send_dhcp_discover(int sock){ packet_xid=random(); discover_packet.xid=htonl(packet_xid); - /**** WHAT THE HECK IS UP WITH THIS?!? IF I DON'T MAKE THIS CALL, ONLY ONE SERVER RESPONSE IS PROCESSED!!!! ****/ - /* downright bizzarre... */ - ntohl(discover_packet.xid); - /*discover_packet.secs=htons(65535);*/ discover_packet.secs=0xFF; diff --git a/plugins/check_curl.c b/plugins/check_curl.c index be5740d..100a97a 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) if( strchr( p, '.' ) != NULL ) { /* HTTP 1.x case */ - char *ppp; - ppp = strtok( p, "." ); + strtok( p, "." ); status_line->http_major = (int)strtol( p, &pp, 10 ); if( *pp != '\0' ) { free( first_line_buf ); return -1; } - ppp = strtok( NULL, " " ); + strtok( NULL, " " ); status_line->http_minor = (int)strtol( p, &pp, 10 ); if( *pp != '\0' ) { free( first_line_buf ); return -1; } p += 4; /* 1.x SP */ -- cgit v0.10-9-g596f