From 0aaa906977e80a24505464402464daed9daa1d47 Mon Sep 17 00:00:00 2001 From: "Dmitriy (BerezhkovDA)" Date: Sat, 11 May 2024 21:18:28 +0300 Subject: [PATCH] =?UTF-8?q?lab4=20=D0=BE=D0=B1=D1=80=D0=B0=D0=B1=D0=BE?= =?UTF-8?q?=D1=82=D0=BA=D0=B0=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BE=D0=BA=20cur?= =?UTF-8?q?l?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sem2_lab1/sem2_lab1.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/sem2_lab1/sem2_lab1.cpp b/sem2_lab1/sem2_lab1.cpp index 4ba33d2..a9f5571 100644 --- a/sem2_lab1/sem2_lab1.cpp +++ b/sem2_lab1/sem2_lab1.cpp @@ -29,12 +29,19 @@ Input input_data(istream& in,bool prompt) } int main(int argc, char* argv[]) { - if (argc > 1) { + if (argc > 1) + { CURL* curl = curl_easy_init(); - if (curl) { + if (curl) + { 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); cout << res <