[PATCH 3/4] ReportsHtml.cc: Restore ostream format

Ryan Long ryan.long at oarcorp.com
Mon Jul 19 17:13:32 UTC 2021


CID 1505939: Not restoring ofstream format

Save format of stream before changing it, and change it back before returning.

Closes #4471
---
 tester/covoar/ReportsHtml.cc | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tester/covoar/ReportsHtml.cc b/tester/covoar/ReportsHtml.cc
index f9bd21f..a4df889 100644
--- a/tester/covoar/ReportsHtml.cc
+++ b/tester/covoar/ReportsHtml.cc
@@ -706,6 +706,8 @@ namespace Coverage {
     const SymbolInformation&                        symbolInfo
   )
   {
+    std::ofstream oldState;
+    oldState.copyfmt( report );
 
     // Mark the background color different for odd and even lines.
     if ( ( count%2 ) != 0 )
@@ -797,6 +799,8 @@ namespace Coverage {
     }
 
     report << "</tr>" << std::endl;
+    report.copyfmt( oldState );
+
     return true;
   }
 
-- 
1.8.3.1



More information about the devel mailing list