From 1b1186172fb51c59ab9f22e1cf312e300c685eb9 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Fri, 16 Sep 2022 15:53:10 +0200 Subject: [PATCH] Fix potential use of invalid data (PVS V1024). --- src/instr/instr_paje_header.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/instr/instr_paje_header.cpp b/src/instr/instr_paje_header.cpp index 44092c26dc..a5a68afd6f 100644 --- a/src/instr/instr_paje_header.cpp +++ b/src/instr/instr_paje_header.cpp @@ -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(); } -- 2.20.1