From dce8af59a6eec2fbca4033853533277f0be165ee Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 22 Mar 2018 13:20:55 +0100 Subject: [PATCH] Tweak --- src/libutil/archive.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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);