From 4b3b3dcee70e756b2dc963c765d0fa823f0edf2d Mon Sep 17 00:00:00 2001 From: "Alice (TimoshenkoAA)" Date: Sat, 25 May 2024 14:42:15 +0300 Subject: [PATCH] =?UTF-8?q?code:=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BA=D0=B8=20?= =?UTF-8?q?curl?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lab01/main.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lab01/main.cpp b/lab01/main.cpp index 03685e1..64f13b0 100644 --- a/lab01/main.cpp +++ b/lab01/main.cpp @@ -45,8 +45,15 @@ main(int argc, char* argv[]) curl_easy_setopt(curl, CURLOPT_URL, argv[1]); res = curl_easy_perform(curl); curl_easy_cleanup(curl); + if (res != CURLE_OK) { + fprintf(stderr, "curl_easy_perform() failed: %s\n", + curl_easy_strerror(res)); + exit(1); + } + curl_easy_cleanup(curl); } - return 0; + + return 0; } const size_t SCREEN_WIDTH = 80;