Skip to content

Commit

Permalink
Merge pull request #598 from stbergmann/uninitialized
Browse files Browse the repository at this point in the history
Always initialize HunspellImpl::suggest_internal's out-parameters
  • Loading branch information
laszlonemeth committed Oct 25, 2018
2 parents 15a7d5f + cbb3b3d commit f51072d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/hunspell/hunspell.cxx
Expand Up @@ -971,6 +971,10 @@ std::vector<std::string> HunspellImpl::suggest(const std::string& word) {

std::vector<std::string> HunspellImpl::suggest_internal(const std::string& word,
bool& capwords, size_t& abbv, int& captype) {
captype = NOCAP;
abbv = 0;
capwords = false;

std::vector<std::string> slst;

int onlycmpdsug = 0;
Expand All @@ -988,8 +992,6 @@ std::vector<std::string> HunspellImpl::suggest_internal(const std::string& word,
if (word.size() >= MAXWORDLEN)
return slst;
}
captype = NOCAP;
abbv = 0;
size_t wl = 0;

std::string scw;
Expand All @@ -1010,7 +1012,6 @@ std::vector<std::string> HunspellImpl::suggest_internal(const std::string& word,
return slst;
}

capwords = false;
bool good = false;

clock_t timelimit;
Expand Down

0 comments on commit f51072d

Please sign in to comment.