CID 1503022: Not restoring ostream format

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

Closes #4470
---
 tester/covoar/CoverageMapBase.cc | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tester/covoar/CoverageMapBase.cc b/tester/covoar/CoverageMapBase.cc
index f0b5890..4de9307 100644
--- a/tester/covoar/CoverageMapBase.cc
+++ b/tester/covoar/CoverageMapBase.cc
@@ -12,9 +12,12 @@
 #include <iomanip>
 
 #include <rld.h>
+#include <rtems-utils.h>
 
 #include "CoverageMapBase.h"
 
+typedef rtems::utils::ostream_guard ostream_guard;
+
 namespace Coverage {
 
   AddressInfo::AddressInfo ()
@@ -75,6 +78,8 @@ namespace Coverage {
 
   void AddressRange::dump (std::ostream& out, bool show_slots) const
   {
+    ostream_guard old_state( out );
+
     out << std::hex << std::setfill('0')
         << "Address range: low = " << std::setw(8) << lowAddress
         << " high = " << std::setw(8) << highAddress
@@ -99,6 +104,7 @@ namespace Coverage {
             << std::endl;
       }
     }
+
   }
 
   CoverageMapBase::CoverageMapBase(
-- 
1.8.3.1

_______________________________________________
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Reply via email to