aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2018-03-22 13:20:55 +0100
committerEelco Dolstra <edolstra@gmail.com>2018-03-22 13:32:18 +0100
commitdce8af59a6eec2fbca4033853533277f0be165ee (patch)
tree3a0bfec4b7c80804fceb908d4eb021f0dfe12e44 /src
parentf87e286e82f37c3746ba62ba5503db90277eeb6e (diff)
Tweak
Diffstat (limited to 'src')
-rw-r--r--src/libutil/archive.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libutil/archive.cc b/src/libutil/archive.cc
index b2459336a..154e2d204 100644
--- a/src/libutil/archive.cc
+++ b/src/libutil/archive.cc
@@ -44,7 +44,7 @@ static void dumpContents(const Path & path, size_t size,
size_t left = size;
while (left > 0) {
- size_t n = left > buf.size() ? buf.size() : left;
+ auto n = std::min(left, buf.size());
readFull(fd.get(), buf.data(), n);
left -= n;
sink(buf.data(), n);