summaryrefslogtreecommitdiff
path: root/docs/examples/anyauthput.c
diff options
context:
space:
mode:
Diffstat (limited to 'docs/examples/anyauthput.c')
-rw-r--r--docs/examples/anyauthput.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/docs/examples/anyauthput.c b/docs/examples/anyauthput.c
index cbb963390..f5db702f5 100644
--- a/docs/examples/anyauthput.c
+++ b/docs/examples/anyauthput.c
@@ -81,17 +81,17 @@ static curlioerr my_ioctl(CURL *handle, curliocmd cmd, void *userp)
static size_t read_callback(char *ptr, size_t size, size_t nmemb, void *stream)
{
ssize_t retcode;
- curl_off_t nread;
+ unsigned long nread;
int *fdp = (int *)stream;
int fd = *fdp;
retcode = read(fd, ptr, (READ_3RD_ARG)(size * nmemb));
- 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;
}