From 2ca91129dcc2ffce3b333abd953be2f94e01ba52 Mon Sep 17 00:00:00 2001 From: GladkyMS Date: Sun, 29 Sep 2024 22:58:25 +0300 Subject: [PATCH] curl:mistakes --- vector.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/vector.cpp b/vector.cpp index 8bba843..924032d 100644 --- a/vector.cpp +++ b/vector.cpp @@ -66,6 +66,11 @@ int main(int argc, char* argv[]) CURLcode res; curl_easy_setopt(curl, CURLOPT_URL, argv[1]); res = curl_easy_perform(curl); + if (res != CURLE_OK) { + fprintf(stderr, "curl_easy_perform() failed: %s\n", + curl_easy_strerror(res)); + exit(1); + } curl_easy_cleanup(curl); } }