|
|
@@ -1211,9 +1211,11 @@ ConfigurationData::ConfigurationData(const string FileName) : |
|
|
|
ifstream CFGFile(FileName.c_str()); // Open the file. |
|
|
|
CFGFile.seekg(0,ios::end); // Seek to the end |
|
|
|
myBufferSize = CFGFile.tellg(); // to find out what size it is. |
|
|
|
myDataBuffer = new char[myBufferSize]; // Make a new buffer the right size. |
|
|
|
myDataBuffer = new char[myBufferSize + 1]; // Make a new buffer the right size, |
|
|
|
// including null byte at end. |
|
|
|
CFGFile.seekg(0,ios::beg); // Seek to the beginning and |
|
|
|
CFGFile.read(myDataBuffer, myBufferSize); // read the file into the buffer. |
|
|
|
myDataBuffer[myBufferSize] = '\0'; // Null-terminate. |
|
|
|
if(CFGFile.bad()) { // If the read failed, we're unusable! |
|
|
|
delete[] myDataBuffer; // Delete the buffer |
|
|
|
myDataBuffer = NULL; // and Null it's pointer. |