From 54b1c596435b0aaf3a2557652ad4bf74d5756514 Mon Sep 17 00:00:00 2001 From: Will Dietz Date: Fri, 1 Jun 2018 10:53:28 -0500 Subject: [PATCH] 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. --- src/libstore/download.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libstore/download.cc b/src/libstore/download.cc index 0b768b591..48d9a42e5 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); }