diff options
| author | Glenn Rice <glennricster@gmail.com> | 2013-01-03 10:35:07 -0600 |
|---|---|---|
| committer | Glenn Rice <glennricster@gmail.com> | 2013-01-03 10:35:07 -0600 |
| commit | 3da05af30ab82639b5898f6ef46326bdd2f1dc7e (patch) | |
| tree | 71438d9ed6ea197007c31b61499e69cd31f56737 /Source/Core/Common | |
| parent | 91023e133b4639f93fbcdb153f66179f7b9b5dff (diff) | |
Fix truncated names and descriptions in the game list on linux.
Diffstat (limited to 'Source/Core/Common')
| -rw-r--r-- | Source/Core/Common/Src/ChunkFile.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Source/Core/Common/Src/ChunkFile.h b/Source/Core/Common/Src/ChunkFile.h index be8b49a3a3..e26536735d 100644 --- a/Source/Core/Common/Src/ChunkFile.h +++ b/Source/Core/Common/Src/ChunkFile.h @@ -155,7 +155,14 @@ public: Do(stringLen); switch (mode) { - case MODE_READ: x = (wchar_t*)*ptr; break; + case MODE_READ: + { + wchar_t* tmp = new wchar_t[stringLen / sizeof(wchar_t)]; + memcpy(tmp, *ptr, stringLen); + x = tmp; + delete[] tmp; + } + break; case MODE_WRITE: memcpy(*ptr, x.c_str(), stringLen); break; case MODE_MEASURE: break; case MODE_VERIFY: _dbg_assert_msg_(COMMON, x == (wchar_t*)*ptr, "Savestate verification failure: \"%ls\" != \"%ls\" (at %p).\n", x.c_str(), (wchar_t*)*ptr, ptr); break; |
