Skip to content

Commit

Permalink
Add emptiness check for /url save and /plugins install
Browse files Browse the repository at this point in the history
Empty file is not a normal condition for file downloading,
thus user has to be notifed.

Related to #1901
  • Loading branch information
H3rnand3zzz committed Nov 10, 2023
1 parent 30fe5f0 commit 092b553
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/tools/http_download.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,10 @@ http_file_get(void* userdata)
err = strdup(curl_easy_strerror(res));
}

if (ftell(outfh) == 0) {
err = strdup("Output file is empty.");
}

curl_easy_cleanup(curl);
curl_global_cleanup();

Expand Down

0 comments on commit 092b553

Please sign in to comment.