clang-tidy: Enable bugprone-implicit-widening-of-multiplication-result
The check diagnoses instances where a result of a multiplication is
implicitly widened, and suggests (with fix-it) to either silence
the code by making widening explicit, or to perform the
multiplication in a wider type, to avoid the widening afterwards.
Change-Id: I97b1b3d3158d753e70bd2bd98f7938dc6e35af5a
Signed-off-by: Pavithra Barithaya <pavithrabarithaya07@gmail.com>
diff --git a/test/utest.cpp b/test/utest.cpp
index 279417a..d436179 100644
--- a/test/utest.cpp
+++ b/test/utest.cpp
@@ -143,7 +143,8 @@
char mdString[EVP_MAX_MD_SIZE * 2 + 1];
for (decltype(digest_count) i = 0; i < digest_count; i++)
{
- snprintf(&mdString[i * 2], 3, "%02x", (unsigned int)digest[i]);
+ snprintf(&mdString[static_cast<size_t>(i) * 2], 3, "%02x",
+ (unsigned int)digest[i]);
}
std::string hexId = std::string(mdString);
hexId = hexId.substr(0, 8);