diff --git a/src/lib/base/String.cpp b/src/lib/base/String.cpp index 4a91027d8..bb673950d 100644 --- a/src/lib/base/String.cpp +++ b/src/lib/base/String.cpp @@ -56,7 +56,7 @@ std::string vformat(const char *fmt, va_list args) index.push_back(i); pos.push_back(static_cast((scan - 1) - fmt)); width.push_back(static_cast((end - scan) + 2)); - if (i > maxIndex) { + if (static_cast(i) > maxIndex) { maxIndex = i; } scan = end; @@ -74,7 +74,7 @@ std::string vformat(const char *fmt, va_list args) std::vector length; value.push_back("%"); length.push_back(1); - for (int i = 0; i < maxIndex; ++i) { + for (size_t i = 0; i < maxIndex; ++i) { const char *arg = va_arg(args, const char *); size_t len = strnlen(arg, SIZE_MAX); value.push_back(arg);