CID 717133 (#1 of 1): Not restoring ostream format (STREAM_FORMAT_STATE)
95. format_changed: fill changes the format state of std::cout for
category fill.
100. end_of_path: Changing format state of stream std::cout for
category fill without later restoring it.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
localtime_r(&t, &bdt);
cout << *i << "\t" << s << "\t";
+ std::ios_base::fmtflags original_flags = cout.flags();
cout.setf(std::ios::right);
cout.fill('0');
cout << std::setw(4) << (bdt.tm_year+1900)
<< ':' << std::setw(2) << bdt.tm_min
<< ':' << std::setw(2) << bdt.tm_sec
<< std::endl;
- cout.unsetf(std::ios::right);
+ cout.flags(original_flags);
}
cout << snaps.size() << " snaps" << std::endl;
}