We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c3abc15 commit be2437dCopy full SHA for be2437d
src/bytewords.cpp
@@ -64,9 +64,13 @@ static const int16_t _lookup[] = {
64
};
65
66
static bool decode_word(const string& word, size_t word_len, uint8_t& output) {
67
- assert(word.length() == word_len);
68
const size_t dim = 26;
69
+ // Sanity check
70
+ if(word.length() != word_len) {
71
+ return false;
72
+ }
73
+
74
// If the coordinates generated by the first and last letters are out of bounds,
75
// or the lookup table contains -1 at the coordinates, then the word is not valid.
76
int x = tolower(word[0]) - 'a';
0 commit comments