mirror of
https://github.com/curl/curl.git
synced 2026-08-24 20:13:35 +03:00
examples: check more errors, fix cleanups, scope variables
Inspired by Joshua's report on examples. Closes #19055
This commit is contained in:
parent
61dcb56743
commit
64ed2ea196
42 changed files with 874 additions and 785 deletions
|
|
@ -89,8 +89,6 @@ static size_t payload_source(char *ptr, size_t size, size_t nmemb, void *userp)
|
|||
int main(void)
|
||||
{
|
||||
CURL *curl;
|
||||
struct curl_slist *recipients = NULL;
|
||||
struct upload_status upload_ctx = { 0 };
|
||||
|
||||
CURLcode res = curl_global_init(CURL_GLOBAL_ALL);
|
||||
if(res)
|
||||
|
|
@ -98,6 +96,9 @@ int main(void)
|
|||
|
||||
curl = curl_easy_init();
|
||||
if(curl) {
|
||||
struct curl_slist *recipients = NULL;
|
||||
struct upload_status upload_ctx = { 0 };
|
||||
|
||||
/* Set username and password */
|
||||
curl_easy_setopt(curl, CURLOPT_USERNAME, "user");
|
||||
curl_easy_setopt(curl, CURLOPT_PASSWORD, "secret");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue