From 6abf609ed91ab9b8e2c1fac0058d034ceef5f0e8 Mon Sep 17 00:00:00 2001 From: Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> Date: Thu, 30 Oct 2025 22:23:51 +0100 Subject: add some comments to explain changed code --- plugins/check_curl.d/check_curl_helpers.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'plugins/check_curl.d/check_curl_helpers.c') diff --git a/plugins/check_curl.d/check_curl_helpers.c b/plugins/check_curl.d/check_curl_helpers.c index d1d282be..d49d8f07 100644 --- a/plugins/check_curl.d/check_curl_helpers.c +++ b/plugins/check_curl.d/check_curl_helpers.c @@ -817,6 +817,8 @@ int curlhelp_parse_statusline(const char *buf, curlhelp_statusline *status_line) buf = start; } + // Accept either LF or CRLF as end of line for the status line + // CRLF is the standard (RFC9112), but it is recommended to accept both size_t length_of_first_line = strcspn(buf, "\r\n"); const char *first_line_end = &buf[length_of_first_line]; if (first_line_end == NULL) { -- cgit v1.2.3-74-g34f1