diff --git a/internal/compact_lang_det_impl.cc b/internal/compact_lang_det_impl.cc index f7f9e3c..a2a96b9 100644 --- a/internal/compact_lang_det_impl.cc +++ b/internal/compact_lang_det_impl.cc @@ -19,6 +19,7 @@ #include #include #include +#include #include "cldutil.h" #include "debug.h" @@ -1537,8 +1538,7 @@ void ApplyHints(const char* buffer, // Put whacks into scoring context // We do not in general want zh-Hans and zh-Hant to be close pairs, // but we do here. Use close_set_count[kCloseSetSize] to count zh, zh-Hant - int close_set_count[kCloseSetSize + 1]; - memset(close_set_count, 0, sizeof(close_set_count)); + std::vector close_set_count(kCloseSetSize + 1, 0); for (int i = 0; i < GetCLDLangPriorCount(&lang_priors); ++i) { Language lang = GetCLDPriorLang(lang_priors.prior[i]);