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 56b9d509a1
commit 23bc00e1a1
6 changed files with 8 additions and 17 deletions

View File

@@ -154,9 +154,8 @@ void QGISVGTemplate::createClickHandles(void)
//read all of PageResult into oStream (except the DrawingContent marker comment - why??)
std::ifstream ifile (fi.filePath().c_str());
while (!ifile.eof())
while (std::getline(ifile,line))
{
std::getline(ifile,line);
// check if the marker in the template is found
if(line.find("<!-- DrawingContent -->") == std::string::npos) {
// if not - write line to oStream