From 992db24119bb3e795c2c2a642f4d8580efdbd7de Mon Sep 17 00:00:00 2001 From: "Alice (VasinaEY)" Date: Sun, 1 Jun 2025 22:21:55 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=B1=D1=80=D0=B0=D0=B1=D0=BE=D1=82?= =?UTF-8?q?=D0=BA=D0=B0=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BE=D0=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/main.cpp b/main.cpp index fcc66bf..5520583 100644 --- a/main.cpp +++ b/main.cpp @@ -53,13 +53,20 @@ int main(int argc, char* argv[]) const char *url = argv[1]; CURL *curl = curl_easy_init(); - if (curl) - { + if (curl) { curl_easy_setopt(curl, CURLOPT_URL, url); curl_easy_perform(curl); + + CURLcode res = curl_easy_perform(curl); + if (res != CURLE_OK) { + cerr << "curl_easy_perform() failed: " << curl_easy_strerror(res) << endl; + exit(1); + } + curl_easy_cleanup(curl); - return 0; } + + return 0; } auto in = input_data(cin,true);