From 9b51c99c6ba5f1b5f256032f6750540d7d8b2b0e Mon Sep 17 00:00:00 2001 From: Glenn Rice Date: Thu, 3 Jan 2013 19:49:19 -0600 Subject: [PATCH] Make sure the null character is not included in the string. --- Source/Core/Common/Src/ChunkFile.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/Common/Src/ChunkFile.h b/Source/Core/Common/Src/ChunkFile.h index 5a6f26e7c3..38e1b2176c 100644 --- a/Source/Core/Common/Src/ChunkFile.h +++ b/Source/Core/Common/Src/ChunkFile.h @@ -155,7 +155,7 @@ public: Do(stringLen); switch (mode) { - case MODE_READ: x.assign((wchar_t*)*ptr, stringLen / sizeof(wchar_t)); break; + case MODE_READ: x.assign((wchar_t*)*ptr, (stringLen / sizeof(wchar_t)) - 1); 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;