diff --git a/src/erasure-code/clay/ErasureCodeClay.cc b/src/erasure-code/clay/ErasureCodeClay.cc index d4f25e31d5f..851d392346b 100644 --- a/src/erasure-code/clay/ErasureCodeClay.cc +++ b/src/erasure-code/clay/ErasureCodeClay.cc @@ -388,7 +388,8 @@ void ErasureCodeClay::get_repair_subchunks(const int &lost_node, int ErasureCodeClay::get_repair_sub_chunk_count(const set &want_to_read) { - int weight_vector[t] = {0}; + int weight_vector[t]; + std::fill(weight_vector, weight_vector + t, 0); for (auto to_read : want_to_read) { weight_vector[to_read / q]++; }