mirror of
https://github.com/curl/curl.git
synced 2026-08-24 16:53:34 +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
|
|
@ -41,17 +41,17 @@
|
|||
static size_t read_callback(char *ptr, size_t size, size_t nmemb, void *stream)
|
||||
{
|
||||
size_t retcode;
|
||||
curl_off_t nread;
|
||||
unsigned long nread;
|
||||
|
||||
/* in real-world cases, this would probably get this data differently
|
||||
as this fread() stuff is exactly what the library already would do
|
||||
by default internally */
|
||||
retcode = fread(ptr, size, nmemb, stream);
|
||||
|
||||
nread = (curl_off_t)retcode;
|
||||
|
||||
fprintf(stderr, "*** We read %" CURL_FORMAT_CURL_OFF_T
|
||||
" bytes from file\n", nread);
|
||||
if(retcode > 0) {
|
||||
nread = (unsigned long)retcode;
|
||||
fprintf(stderr, "*** We read %lu bytes from file\n", nread);
|
||||
}
|
||||
|
||||
return retcode;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue