瀏覽代碼

Return on error from tellg().

adeniz_1
Alban Deniz 1 年之前
父節點
當前提交
dfa5ec03cc
共有 1 個檔案被更改,包括 4 行新增2 行删除
  1. 4
    2
      XMLReader.cpp

+ 4
- 2
XMLReader.cpp 查看文件

@@ -1229,8 +1229,10 @@ XMLReaderData::XMLReaderData(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.
if (myBufferSize < 0)
throw;
if (myBufferSize < 0) {
myBufferSize = 0;
return;
}
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

Loading…
取消
儲存