mirror of
https://github.com/curl/curl.git
synced 2026-08-25 20:53:37 +03:00
docs/examples: workaround broken -Wno-pedantic-ms-format
Avoid CURL_FORMAT_CURL_OFF_T by using unsigned long instead. Improve size_t to long conversion in imap-append.c example. Ref: https://github.com/curl/curl/issues/6079 Ref: https://github.com/curl/curl/pull/6082 Assisted-by: Jay Satiro Reviewed-by: Daniel Stenberg Preparation of #7922
This commit is contained in:
parent
52202691d1
commit
77311f420a
9 changed files with 45 additions and 45 deletions
|
|
@ -89,7 +89,8 @@ int main(void)
|
|||
|
||||
curl = curl_easy_init();
|
||||
if(curl) {
|
||||
long infilesize;
|
||||
size_t filesize;
|
||||
long infilesize = LONG_MAX;
|
||||
struct upload_status upload_ctx = { 0 };
|
||||
|
||||
/* Set username and password */
|
||||
|
|
@ -108,7 +109,9 @@ int main(void)
|
|||
curl_easy_setopt(curl, CURLOPT_READDATA, &upload_ctx);
|
||||
curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L);
|
||||
|
||||
infilesize = strlen(payload_text);
|
||||
filesize = strlen(payload_text);
|
||||
if(filesize <= LONG_MAX)
|
||||
infilesize = (long)filesize;
|
||||
curl_easy_setopt(curl, CURLOPT_INFILESIZE, infilesize);
|
||||
|
||||
/* Perform the append */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue