diff options
Diffstat (limited to 'docs/examples/imap-append.c')
-rw-r--r-- | docs/examples/imap-append.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/docs/examples/imap-append.c b/docs/examples/imap-append.c index 78ecc8d01..e36cb10c0 100644 --- a/docs/examples/imap-append.c +++ b/docs/examples/imap-append.c @@ -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 */ |