From df8d6c06a60a37fbd90979723c484865689f3ef3 Mon Sep 17 00:00:00 2001 From: michaelangel007 Date: Thu, 24 Aug 2017 18:43:10 -0700 Subject: [PATCH] Fix #473 read debugger script file not being properly zero-terminated --- source/Debugger/Util_MemoryTextFile.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/source/Debugger/Util_MemoryTextFile.cpp b/source/Debugger/Util_MemoryTextFile.cpp index dfd54fe4..5835fa12 100644 --- a/source/Debugger/Util_MemoryTextFile.cpp +++ b/source/Debugger/Util_MemoryTextFile.cpp @@ -34,7 +34,7 @@ const int EOL_NULL = 0; bool MemoryTextFile_t::Read( char *pFileName ) { bool bStatus = false; - FILE *hFile = fopen( pFileName, "rt" ); + FILE *hFile = fopen( pFileName, "rb" ); if (hFile) { @@ -47,9 +47,6 @@ bool MemoryTextFile_t::Read( char *pFileName ) char *pBuffer = & m_vBuffer.at(0); fread( (void*)pBuffer, nSize, 1, hFile ); - - m_vBuffer.push_back( EOL_NULL ); - fclose(hFile); m_bDirty = true;