summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRincewindsHat <12514511+RincewindsHat@users.noreply.github.com>2022-12-22 13:16:19 +0100
committerSven Nierlein <sven@nierlein.org>2023-01-07 18:34:46 +0100
commit6ed7a75c3b4565af54b8fd4d96225a36a705a0fd (patch)
treec83ea567fbe409a5b90ae09ab3d531df6a64aaf0
parent67d10625307a1bcd5def7cc298314706cef78182 (diff)
downloadmonitoring-plugins-6ed7a75.tar.gz
Reformat a part to increase readability
-rw-r--r--plugins/check_http.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/plugins/check_http.c b/plugins/check_http.c
index dbaa0d78..a9c22389 100644
--- a/plugins/check_http.c
+++ b/plugins/check_http.c
@@ -1246,13 +1246,23 @@ check_http (void)
1246 if (strstr(header, header_expect) == NULL) { 1246 if (strstr(header, header_expect) == NULL) {
1247 // We did not find the header, the rest is for building the output and setting the state 1247 // We did not find the header, the rest is for building the output and setting the state
1248 char output_header_search[30] = ""; 1248 char output_header_search[30] = "";
1249
1249 strncpy(&output_header_search[0], header_expect, 1250 strncpy(&output_header_search[0], header_expect,
1250 sizeof(output_header_search)); 1251 sizeof(output_header_search));
1252
1251 if (output_header_search[sizeof(output_header_search) - 1] != '\0') { 1253 if (output_header_search[sizeof(output_header_search) - 1] != '\0') {
1252 bcopy("...", &output_header_search[sizeof(output_header_search) - 4], 1254 bcopy("...",
1253 4); 1255 &output_header_search[sizeof(output_header_search) - 4],
1256 4);
1254 } 1257 }
1255 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); 1258
1259 xasprintf (&msg,
1260 _("%sheader '%s' not found on '%s://%s:%d%s', "),
1261 msg,
1262 output_header_search, use_ssl ? "https" : "http",
1263 host_name ? host_name : server_address, server_port,
1264 server_url);
1265
1256 result = STATE_CRITICAL; 1266 result = STATE_CRITICAL;
1257 } 1267 }
1258 } 1268 }