diff --git a/tokenizer.cpp b/tokenizer.cpp index 7d911d300..113f8926e 100644 --- a/tokenizer.cpp +++ b/tokenizer.cpp @@ -64,7 +64,6 @@ static const wchar_t *tok_desc[] = { N_(L"Tokenizer not yet initialized"), N_(L"Tokenizer error"), - N_(L"Invalid token"), N_(L"String"), N_(L"Pipe"), N_(L"End of command"), @@ -77,6 +76,8 @@ static const wchar_t *tok_desc[] = N_(L"Comment") }; + + /** Set the latest tokens string to be the specified error message */ @@ -559,7 +560,7 @@ static bool my_iswspace(wchar_t c) const wchar_t *tok_get_desc(int type) { - if (type < 0 || (size_t)type >= sizeof(tok_desc)) + if (type < 0 || (size_t)type >= (sizeof tok_desc / sizeof *tok_desc)) { return _(L"Invalid token type"); }