PVS: V1024 The 'file' stream is checked for EOF before reading from it, but is not checked after reading. Potential use of invalid data

This commit is contained in:
wmayer
2019-03-13 13:34:45 +01:00
parent d232164ba0
commit 93f0d1bec9
6 changed files with 8 additions and 17 deletions

View File

@@ -156,9 +156,8 @@ App::DocumentObjectExecReturn * DrawSVGTemplate::execute(void)
//remove DrawingContent comment line
//change line endings
//capture TitleBlock dimensions
while (!inTemplate.eof())
while (getline(inTemplate,line))
{
getline(inTemplate,line);
// copy every line except the DrawingContent comment?
if(line.find("<!-- DrawingContent -->") == string::npos) {
// if not - write through
@@ -287,8 +286,7 @@ std::map<std::string, std::string> DrawSVGTemplate::getEditableTextsFromTemplate
}
string tline, tfrag;
ifstream tfile (tfi.filePath().c_str());
while (!tfile.eof()) {
getline (tfile,tline);
while (getline (tfile,tline)) {
tfrag += tline;
tfrag += "--endOfLine--";
}