mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-29 04:08:55 +00:00
Fixed some valgrind warnings.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@523 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
0ba3948c42
commit
a56fcd4e98
7 changed files with 212 additions and 10 deletions
|
@ -165,6 +165,11 @@ void StringFromFormatV(std::string* out, const char* format, va_list args)
|
|||
delete [] buf;
|
||||
buf = new char[newSize + 1];
|
||||
writtenCount = vsnprintf(buf, newSize, format, args);
|
||||
// ARGH! vsnprintf does no longer return -1 on truncation in newer libc!
|
||||
// WORKAROUND! let's fake the old behaviour (even though it's less efficient).
|
||||
// TODO: figure out why the fix causes an invalid read in strlen called from vsnprintf :(
|
||||
if (writtenCount >= (int)newSize)
|
||||
writtenCount = -1;
|
||||
newSize *= 2;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue