Skip to content

Commit

Permalink
Make manifest_dump not blocked when printing null char (#275)
Browse files Browse the repository at this point in the history
Signed-off-by: Xintao <hunterlxt@live.com>
  • Loading branch information
hunterlxt committed May 7, 2022
1 parent 9dcc333 commit 61b0e36
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions db/version_set.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4889,8 +4889,10 @@ Status VersionSet::DumpManifest(Options& options, std::string& dscname,
printf("--------------- Column family \"%s\" (ID %" PRIu32
") --------------\n",
cfd->GetName().c_str(), cfd->GetID());
printf("%s at level %d\n", files[i]->DebugString(hex).c_str(),
level);
auto debugged_string = files[i]->DebugString(hex);
fwrite(debugged_string.data(), sizeof(char), debugged_string.size(),
stdout);
printf(" at level %d\n", level);
break;
}
}
Expand All @@ -4907,7 +4909,9 @@ Status VersionSet::DumpManifest(Options& options, std::string& dscname,
} else {
printf("comparator: <NO COMPARATOR>\n");
}
printf("%s \n", v->DebugString(hex).c_str());
auto debugged_string = v->DebugString(hex);
fwrite(debugged_string.data(), sizeof(char), debugged_string.size(),
stdout);
}
delete v;
}
Expand Down

0 comments on commit 61b0e36

Please sign in to comment.