diff --git a/src/main.cpp b/src/main.cpp index 4d7d272..6581f96 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -762,6 +762,12 @@ int main(int argc, char* argv[]) guess = commandGuesses.begin()->first; } + if(guess.length() != valids[0].length()) + { + std::cout << "Invalid word length of " << guess.length() << ": '" << guess << "'" << std::endl; + return 0; + } + std::transform(guess.begin(), guess.end(), guess.begin(), ::tolower); if(valids.size() > 1 || valids.size() == 1) @@ -777,6 +783,12 @@ int main(int argc, char* argv[]) rating = commandGuesses.begin()->second; } + if(rating.length() != valids[0].length()) + { + std::cout << "Invalid rating length of " << rating.length() << ": '" << rating << "'" << std::endl; + return 0; + } + valids = filter(valids,std::make_pair(guess, rating)); std::cout << "There are now " << valids.size() << " answers"; if(hardmode == 'u')