diff --git a/Source/Core/Common/Src/StringUtil.cpp b/Source/Core/Common/Src/StringUtil.cpp index 707d519577..33b4a73897 100644 --- a/Source/Core/Common/Src/StringUtil.cpp +++ b/Source/Core/Common/Src/StringUtil.cpp @@ -69,8 +69,11 @@ std::string StringFromFormat(const char* format, ...) #ifndef _WIN32 // vsnprintf does not return -1 on truncation in linux! // Instead it returns the size of the string we need. - if (writtenCount >= (int)newSize) + if (writtenCount > (int)newSize) + { newSize = writtenCount; + writtenCount = -1; + } #else newSize *= 2; #endif