Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix potential use of invalid data (PVS V1024).
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Fri, 16 Sep 2022 13:53:10 +0000 (15:53 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Fri, 16 Sep 2022 13:54:27 +0000 (15:54 +0200)
src/instr/instr_paje_header.cpp

index 44092c2..a5a68af 100644 (file)
@@ -34,11 +34,9 @@ void dump_comment_file(const std::string& filename)
     throw TracingError(XBT_THROW_POINT,
                        xbt::string_printf("Comment file %s could not be opened for reading.", filename.c_str()));
 
-  while (not fs.eof()) {
-    std::string line;
-    std::getline(fs, line);
+  std::string line;
+  while (std::getline(fs, line))
     tracing_file << "# " << line;
-  }
   fs.close();
 }