about summary refs log tree commit diff
diff options
context:
space:
mode:
authorWill Dietz <w@wdtz.org>2018-06-01T15·53-0500
committerWill Dietz <w@wdtz.org>2018-06-01T15·59-0500
commit54b1c596435b0aaf3a2557652ad4bf74d5756514 (patch)
treeb12c57c5690b434620fd7afd0e2c407705ebd1d1
parent73357500aca2ad4a2d82111993fbd5aaf0af4ec6 (diff)
download.cc: fix readCallback return type (int -> size_t)
I'm not sure if curl ever asks for enough data at once
for truncation to occur but better safe than sorry.
-rw-r--r--src/libstore/download.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libstore/download.cc b/src/libstore/download.cc
index 0b768b591783..48d9a42e590b 100644
--- a/src/libstore/download.cc
+++ b/src/libstore/download.cc
@@ -213,7 +213,7 @@ struct CurlDownloader : public Downloader
         }
 
         size_t readOffset = 0;
-        int readCallback(char *buffer, size_t size, size_t nitems)
+        size_t readCallback(char *buffer, size_t size, size_t nitems)
         {
             if (readOffset == request.data->length())
                 return 0;
@@ -224,7 +224,7 @@ struct CurlDownloader : public Downloader
             return count;
         }
 
-        static int readCallbackWrapper(char *buffer, size_t size, size_t nitems, void * userp)
+        static size_t readCallbackWrapper(char *buffer, size_t size, size_t nitems, void * userp)
         {
             return ((DownloadItem *) userp)->readCallback(buffer, size, nitems);
         }