From 35e9e54fadeea03ba94e16ee2316069c0d9695d7 Mon Sep 17 00:00:00 2001 From: Joe George Date: Mon, 3 Oct 2016 13:43:45 -0400 Subject: Another fix for ICE-7399 --- cpp/src/IcePatch2Lib/ClientUtil.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cpp') diff --git a/cpp/src/IcePatch2Lib/ClientUtil.cpp b/cpp/src/IcePatch2Lib/ClientUtil.cpp index abea43b2ee7..d37f6af9b98 100644 --- a/cpp/src/IcePatch2Lib/ClientUtil.cpp +++ b/cpp/src/IcePatch2Lib/ClientUtil.cpp @@ -856,8 +856,8 @@ PatcherI::updateFilesInternal(const LargeFileInfoSeq& files, const DecompressorP // 'bytes' is always returned with size '_chunkSize'. When a file is smaller than '_chunkSize' // or we are reading the last chunk of a file, 'bytes' will be larger than necessary. In this // case we calculate the current position and updated size based on the known file size. - Ice::Long size = static_cast(pos + bytes.size() > p->size ? p->size - pos : - bytes.size()); + size_t size = (pos + bytes.size()) > static_cast(p->size) ? + static_cast(p->size - pos) : bytes.size(); pos += size; updated += size; -- cgit v1.2.3