From 5e36362a4c9376c5d32f3d07655d4d482edef3ad Mon Sep 17 00:00:00 2001 From: Blaypeg Date: Sun, 18 May 2014 13:28:11 +0100 Subject: [PATCH] int ->size_t --- Utilities/StrFmt.cpp | 4 ++-- Utilities/StrFmt.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Utilities/StrFmt.cpp b/Utilities/StrFmt.cpp index e67437ae00..fc469c7b79 100644 --- a/Utilities/StrFmt.cpp +++ b/Utilities/StrFmt.cpp @@ -14,8 +14,8 @@ std::string fmt::FormatV(const char *fmt, va_list args) for (;;) { std::vector buffptr(length); - int printlen = vsnprintf(buffptr.data(), length, fmt, args); - if (printlen >= 0 && printlen < length) + size_t printlen = vsnprintf(buffptr.data(), length, fmt, args); + if (printlen < length) { str = std::string(buffptr.data(), printlen); break; diff --git a/Utilities/StrFmt.h b/Utilities/StrFmt.h index d4e46917eb..744d6ea189 100644 --- a/Utilities/StrFmt.h +++ b/Utilities/StrFmt.h @@ -86,9 +86,9 @@ namespace fmt{ std::vector buffptr(length); #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wformat-security" - int printlen = snprintf(buffptr.data(), length, fmt.c_str(), std::forward(parameters)...); + size_t printlen = snprintf(buffptr.data(), length, fmt.c_str(), std::forward(parameters)...); #pragma clang diagnostic pop - if (printlen >= 0 && printlen < length) + if (printlen < length) { str = string(buffptr.data(), printlen); break;