From 895f1500a5c6c455753ec66fc0d007c6abae9289 Mon Sep 17 00:00:00 2001 From: Glenn Rice Date: Wed, 10 Nov 2010 05:18:20 +0000 Subject: [PATCH] Fix for my tweak in the last commit. I knew I had that working at one point. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6369 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Common/Src/StringUtil.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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