From 3b232ee17d8f3d93bf3535b77fbb436cb9a9c2e0 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Sun, 26 May 2024 21:32:45 +0200 Subject: [PATCH] IVSIS3LikeFSHandler::GetUploadChunkSizeInBytes(): rewrite test in a way to please Coverity Scan (CID 1546505, 1546504) --- port/cpl_vsil_s3.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/port/cpl_vsil_s3.cpp b/port/cpl_vsil_s3.cpp index efe3c5b1a44a..21874af71f61 100644 --- a/port/cpl_vsil_s3.cpp +++ b/port/cpl_vsil_s3.cpp @@ -807,7 +807,8 @@ size_t IVSIS3LikeFSHandler::GetUploadChunkSizeInBytes( nChunkSize = static_cast(GetDefaultPartSizeInMiB()) * MIB_CONSTANT; } - else if (nChunkSizeInt / MIB_CONSTANT >= GetMaximumPartSizeInMiB()) + else if (nChunkSizeInt > + static_cast(GetMaximumPartSizeInMiB()) * MIB_CONSTANT) { CPLError(CE_Warning, CPLE_AppDefined, "Specified chunk size too large. Clamping to %d MiB",