Skip to content

Commit

Permalink
1.1.1: fix shadowed variable in api-fetcher.c
Browse files Browse the repository at this point in the history
  • Loading branch information
esselfe committed Nov 8, 2023
1 parent 81f4da5 commit 51147cb
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/api-fetcher.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ static char *APIAstro(char *city) {
}
curl_easy_setopt(handle, CURLOPT_WRITEDATA, (void *)fp);

CURLcode ret = curl_easy_perform(handle);
if (ret != CURLE_OK) {
printf("api-fetcher error (curl): %s\n", curl_easy_strerror(ret));
CURLcode ret2 = curl_easy_perform(handle);
if (ret2 != CURLE_OK) {
printf("api-fetcher error (curl): %s\n", curl_easy_strerror(ret2));
curl_easy_cleanup(handle);
return NULL;
}
Expand Down Expand Up @@ -210,9 +210,9 @@ static char *APIForecast(char *city) {
}
curl_easy_setopt(handle, CURLOPT_WRITEDATA, (void *)fp);

CURLcode ret = curl_easy_perform(handle);
if (ret != CURLE_OK) {
printf("api-fetcher error (curl): %s\n", curl_easy_strerror(ret));
CURLcode ret2 = curl_easy_perform(handle);
if (ret2 != CURLE_OK) {
printf("api-fetcher error (curl): %s\n", curl_easy_strerror(ret2));
curl_easy_cleanup(handle);
fclose(fp);
return NULL;
Expand Down Expand Up @@ -409,9 +409,9 @@ static char *APITime(char *city) {
}
curl_easy_setopt(handle, CURLOPT_WRITEDATA, (void *)fp);

CURLcode ret = curl_easy_perform(handle);
if (ret != CURLE_OK) {
printf("api-fetcher error (curl): %s\n", curl_easy_strerror(ret));
CURLcode ret2 = curl_easy_perform(handle);
if (ret2 != CURLE_OK) {
printf("api-fetcher error (curl): %s\n", curl_easy_strerror(ret2));
curl_easy_cleanup(handle);
fclose(fp);
return NULL;
Expand Down Expand Up @@ -507,9 +507,9 @@ static char *APIWeather(char *city) {
}
curl_easy_setopt(handle, CURLOPT_WRITEDATA, (void *)fp);

CURLcode ret = curl_easy_perform(handle);
if (ret != CURLE_OK) {
printf("api-fetcher error (curl): %s\n", curl_easy_strerror(ret));
CURLcode ret2 = curl_easy_perform(handle);
if (ret2 != CURLE_OK) {
printf("api-fetcher error (curl): %s\n", curl_easy_strerror(ret2));
curl_easy_cleanup(handle);
fclose(fp);
return NULL;
Expand Down

0 comments on commit 51147cb

Please sign in to comment.