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);