[monitoring-plugins] Reformat a part to increase readability
Sven Nierlein
git at monitoring-plugins.org
Sat Jan 7 18:40:14 CET 2023
Module: monitoring-plugins
Branch: master
Commit: 6ed7a75c3b4565af54b8fd4d96225a36a705a0fd
Author: RincewindsHat <12514511+RincewindsHat at users.noreply.github.com>
Committer: Sven Nierlein <sven at nierlein.org>
Date: Thu Dec 22 13:16:19 2022 +0100
URL: https://www.monitoring-plugins.org/repositories/monitoring-plugins/commit/?id=6ed7a75
Reformat a part to increase readability
---
plugins/check_http.c | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/plugins/check_http.c b/plugins/check_http.c
index dbaa0d7..a9c2238 100644
--- a/plugins/check_http.c
+++ b/plugins/check_http.c
@@ -1246,13 +1246,23 @@ check_http (void)
if (strstr(header, header_expect) == NULL) {
// We did not find the header, the rest is for building the output and setting the state
char output_header_search[30] = "";
+
strncpy(&output_header_search[0], header_expect,
sizeof(output_header_search));
+
if (output_header_search[sizeof(output_header_search) - 1] != '\0') {
- bcopy("...", &output_header_search[sizeof(output_header_search) - 4],
- 4);
+ bcopy("...",
+ &output_header_search[sizeof(output_header_search) - 4],
+ 4);
}
- xasprintf (&msg, _("%sheader '%s' not found on '%s://%s:%d%s', "), msg, output_header_search, use_ssl ? "https" : "http", host_name ? host_name : server_address, server_port, server_url);
+
+ xasprintf (&msg,
+ _("%sheader '%s' not found on '%s://%s:%d%s', "),
+ msg,
+ output_header_search, use_ssl ? "https" : "http",
+ host_name ? host_name : server_address, server_port,
+ server_url);
+
result = STATE_CRITICAL;
}
}
More information about the Commits
mailing list