diff --git a/db/db_impl.cc b/db/db_impl.cc index 5a4a0ab60..923abd5db 100644 --- a/db/db_impl.cc +++ b/db/db_impl.cc @@ -948,8 +948,8 @@ Status DBImpl::DoCompactionWork(CompactionState* compact) { compact->compaction->level(), compact->compaction->num_input_files(1), compact->compaction->level() + 1); - char scratch[200]; - compact->compaction->Summary(scratch, 256); + char scratch[256]; + compact->compaction->Summary(scratch, sizeof(scratch)); Log(options_.info_log, "Compaction start summary: %s\n", scratch); assert(versions_->NumLevelFiles(compact->compaction->level()) > 0); diff --git a/db/version_set.cc b/db/version_set.cc index 1fcf831c8..141036536 100644 --- a/db/version_set.cc +++ b/db/version_set.cc @@ -1620,10 +1620,10 @@ void Compaction::Summary(char* output, int len) { return; char level_low_summary[100]; - InputSummary(inputs_[0], level_low_summary, 100); + InputSummary(inputs_[0], level_low_summary, sizeof(level_low_summary)); char level_up_summary[100]; if (inputs_[1].size()) { - InputSummary(inputs_[1], level_up_summary, 100); + InputSummary(inputs_[1], level_up_summary, sizeof(level_up_summary)); } else { level_up_summary[0] = '\0'; }