[monitoring-plugins] fix compiler warnings for unused variables

RincewindsHat git at monitoring-plugins.org
Sun Oct 15 22:00:14 CEST 2023


 Module: monitoring-plugins
 Branch: master
 Commit: ceb614aad46423170e284e66023c7a2e8c513338
 Author: RincewindsHat <12514511+RincewindsHat at users.noreply.github.com>
   Date: Sun Oct 15 19:10:43 2023 +0200
    URL: https://www.monitoring-plugins.org/repositories/monitoring-plugins/commit/?id=ceb614a

fix compiler warnings for unused variables

---

 plugins/check_curl.c | 14 ++++++++++++--
 plugins/check_ldap.c |  3 ---
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/plugins/check_curl.c b/plugins/check_curl.c
index da578b5..153e492 100644
--- a/plugins/check_curl.c
+++ b/plugins/check_curl.c
@@ -1218,6 +1218,10 @@ redir (curlhelp_write_curlbuf* header_buf)
     &status_line.http_major, &status_line.http_minor, &status_line.http_code, &status_line.msg, &msglen,
     headers, &nof_headers, 0);
 
+	if (res == -1) {
+		die (STATE_UNKNOWN, _("HTTP UNKNOWN - Failed to parse Response\n"));
+	}
+
   location = get_header_value (headers, nof_headers, "location");
 
   if (verbose >= 2)
@@ -2388,6 +2392,10 @@ check_document_dates (const curlhelp_write_curlbuf *header_buf, char (*msg)[DEFA
     &status_line.http_major, &status_line.http_minor, &status_line.http_code, &status_line.msg, &msglen,
     headers, &nof_headers, 0);
 
+	if (res == -1) {
+		die (STATE_UNKNOWN, _("HTTP UNKNOWN - Failed to parse Response\n"));
+	}
+
   server_date = get_header_value (headers, nof_headers, "date");
   document_date = get_header_value (headers, nof_headers, "last-modified");
 
@@ -2463,9 +2471,7 @@ check_document_dates (const curlhelp_write_curlbuf *header_buf, char (*msg)[DEFA
 int
 get_content_length (const curlhelp_write_curlbuf* header_buf, const curlhelp_write_curlbuf* body_buf)
 {
-  const char *s;
   int content_length = 0;
-  char *copy;
   struct phr_header headers[255];
   size_t nof_headers = 255;
   size_t msglen;
@@ -2476,6 +2482,10 @@ get_content_length (const curlhelp_write_curlbuf* header_buf, const curlhelp_wri
     &status_line.http_major, &status_line.http_minor, &status_line.http_code, &status_line.msg, &msglen,
     headers, &nof_headers, 0);
 
+	if (res == -1) {
+		die (STATE_UNKNOWN, _("HTTP UNKNOWN - Failed to parse Response\n"));
+	}
+
   content_length_s = get_header_value (headers, nof_headers, "content-length");
   if (!content_length_s) {
     return header_buf->buflen + body_buf->buflen;
diff --git a/plugins/check_ldap.c b/plugins/check_ldap.c
index a1bfe1b..15113b1 100644
--- a/plugins/check_ldap.c
+++ b/plugins/check_ldap.c
@@ -97,9 +97,6 @@ main (int argc, char *argv[])
 	int tls;
 	int version=3;
 
-	/* for entry counting */
-
-	LDAPMessage *next_entry;
 	int status_entries = STATE_OK;
 	int num_entries = 0;
 



More information about the Commits mailing list