From 983470dc5d486bc90f198289875729ae587d7684 Mon Sep 17 00:00:00 2001 From: Svet <70716489+ikyman@users.noreply.github.com> Date: Tue, 14 Jul 2026 16:12:48 -0400 Subject: [PATCH] curl_easy_strerror parameter documentation fix This makes the example more that the error code should be passed into libcurl function curl_easy_strerror. Previously, this documentation told me to use the variable name "res" as input to curl_easy_strerror. This "res" variable is undefined. The obvious replacement for "res" is the existing "response" variable. The response variable is a curl-simple-https ServerResponse Struct. It is incompatible as a parameter for curl_easy_strerror. This fix makes explicit that the curl_easy_strerror takes in the response code. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2f01489..71c8dcb 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ int main(void) { printf("status_code: %l\n# response\n%s", response.code, response.body); return EXIT_SUCCESS; } else { - fprintf(stderr, "curl error: %s\n", curl_easy_strerror(res)); + fprintf(stderr, "curl error: %s\n", curl_easy_strerror(response.code)); return EXIT_SUCCESS; } }