diff --git a/src/engine/shared/linereader.cpp b/src/engine/shared/linereader.cpp index 18868e151..05c97f9af 100644 --- a/src/engine/shared/linereader.cpp +++ b/src/engine/shared/linereader.cpp @@ -4,7 +4,7 @@ void CLineReader::Init(IOHANDLE File) { - m_BufferMaxSize = sizeof(m_aBuffer); + m_BufferMaxSize = sizeof(m_aBuffer) - 1; m_BufferSize = 0; m_BufferPos = 0; m_File = File; diff --git a/src/engine/shared/linereader.h b/src/engine/shared/linereader.h index b66bcf82b..b97cd40ef 100644 --- a/src/engine/shared/linereader.h +++ b/src/engine/shared/linereader.h @@ -7,7 +7,7 @@ // buffered stream for reading lines, should perhaps be something smaller class CLineReader { - char m_aBuffer[4 * 8192]; + char m_aBuffer[4 * 8192 + 1]; // 1 additional byte for null termination unsigned m_BufferPos; unsigned m_BufferSize; unsigned m_BufferMaxSize;