diff --git a/src/c_api.cpp b/src/c_api.cpp index f0a823c2990e..b67a8748fb39 100644 --- a/src/c_api.cpp +++ b/src/c_api.cpp @@ -523,7 +523,7 @@ class Booster { for (const auto& name : boosting_->FeatureNames()) { if (idx < len) { std::memcpy(out_strs[idx], name.c_str(), std::min(name.size() + 1, buffer_len)); - out_strs[idx][buffer_len-1] = '\0'; + out_strs[idx][buffer_len - 1] = '\0'; } *out_buffer_len = std::max(name.size() + 1, *out_buffer_len); ++idx;