diff options
| author | Glenn Rice <glennricster@gmail.com> | 2010-11-10 05:18:20 +0000 |
|---|---|---|
| committer | Glenn Rice <glennricster@gmail.com> | 2010-11-10 05:18:20 +0000 |
| commit | 895f1500a5c6c455753ec66fc0d007c6abae9289 (patch) | |
| tree | 7fd3b71f2f73d223cfcdd4a8384040e8be06b8db /Source/Core/Common/Src/StringUtil.cpp | |
| parent | 92a5b72b42c2880381826253048a252ef1dad9e1 (diff) | |
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
Diffstat (limited to 'Source/Core/Common/Src/StringUtil.cpp')
| -rw-r--r-- | Source/Core/Common/Src/StringUtil.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
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 |
