Fix metadata dump() output

This commit is contained in:
Marcus Holland-Moritz 2021-03-18 23:35:07 +01:00
parent 71e92b2005
commit 0fa8e29897

View File

@ -621,8 +621,9 @@ void metadata_<LoggerPolicy>::dump(
if (auto ts = meta_.create_timestamp()) { if (auto ts = meta_.create_timestamp()) {
time_t tp = *ts; time_t tp = *ts;
std::string str(20, '\0'); std::string str(32, '\0');
std::strftime(str.data(), str.size(), "%F %T", std::localtime(&tp)); str.resize(
std::strftime(str.data(), str.size(), "%F %T", std::localtime(&tp)));
os << "created on: " << str << std::endl; os << "created on: " << str << std::endl;
} }
@ -633,7 +634,7 @@ void metadata_<LoggerPolicy>::dump(
} }
if (detail_level > 1) { if (detail_level > 1) {
os << "inode_count: " << inode_count_; os << "inode_count: " << inode_count_ << std::endl;
os << "symlink_inode_offset: " << symlink_inode_offset_ << std::endl; os << "symlink_inode_offset: " << symlink_inode_offset_ << std::endl;
os << "file_inode_offset: " << file_inode_offset_ << std::endl; os << "file_inode_offset: " << file_inode_offset_ << std::endl;
os << "dev_inode_offset: " << dev_inode_offset_ << std::endl; os << "dev_inode_offset: " << dev_inode_offset_ << std::endl;