aboutsummaryrefslogtreecommitdiff
path: root/src/libutil/archive.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2020-12-02 14:10:56 +0100
committerEelco Dolstra <edolstra@gmail.com>2020-12-02 14:17:27 +0100
commit1b79b5b983a6c775766bd0d1c7881042188998b8 (patch)
treef695f8298291fccb6db02bc705445909ba729039 /src/libutil/archive.cc
parentfaa31f40846f7a4dbc2487d000b112a6aef69d1b (diff)
read(): Use char * instead of unsigned char *
This gets rid of some pointless casts.
Diffstat (limited to 'src/libutil/archive.cc')
-rw-r--r--src/libutil/archive.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libutil/archive.cc b/src/libutil/archive.cc
index 046ef841b..ed0eb2fb5 100644
--- a/src/libutil/archive.cc
+++ b/src/libutil/archive.cc
@@ -50,14 +50,14 @@ static void dumpContents(const Path & path, size_t size,
AutoCloseFD fd = open(path.c_str(), O_RDONLY | O_CLOEXEC);
if (!fd) throw SysError("opening file '%1%'", path);
- std::vector<unsigned char> buf(65536);
+ std::vector<char> buf(65536);
size_t left = size;
while (left > 0) {
auto n = std::min(left, buf.size());
readFull(fd.get(), buf.data(), n);
left -= n;
- sink({(char *) buf.data(), n});
+ sink({buf.data(), n});
}
writePadding(size, sink);
@@ -155,14 +155,14 @@ static void parseContents(ParseSink & sink, Source & source, const Path & path)
sink.preallocateContents(size);
uint64_t left = size;
- std::vector<unsigned char> buf(65536);
+ std::vector<char> buf(65536);
while (left) {
checkInterrupt();
auto n = buf.size();
if ((uint64_t)n > left) n = left;
source(buf.data(), n);
- sink.receiveContents({(char *) buf.data(), n});
+ sink.receiveContents({buf.data(), n});
left -= n;
}