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. --- lib/utils_base.c | 8 ++++---- plugins-root/check_dhcp.c | 4 ---- plugins/check_curl.c | 5 ++--- 3 files changed, 6 insertions(+), 11 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 @@ * *****************************************************************************/ -#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 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){ 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 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) 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 v1.2.3-74-g34f1