From 612ef2cde1f330de3562c91650f6267c0d6b67d6 Mon Sep 17 00:00:00 2001 From: BaranovEK Date: Tue, 4 Jun 2024 21:17:00 +0300 Subject: [PATCH] code: errors of easy init --- main.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/main.cpp b/main.cpp index 0a412b1..55f090b 100644 --- a/main.cpp +++ b/main.cpp @@ -44,13 +44,17 @@ int main(int argc, char* argv[]) if(curl) { CURLcode res; - curl_easy_setopt(curl, CURLOPT_URL, argv[1]); + curl_easy_setopt(curl, CURLOPT_URL, argv[0]); res = curl_easy_perform(curl); + if (res!=CURLE_OK){ + cerr << curl_easy_strerror(res); + exit(1); + } curl_easy_cleanup(curl); } return 0; } - Input in = input_data(cin, false); + Input in = input_data(cin, true); vector bins = make_histogram(in.numbers, in.bin_count); show_histogram_svg(bins);