Fix assert in AutoCompletion::isAllDigits methode

Fix debug mode assert in `AutoCompletion::isAllDigits` methode while inputting non ASCII characters.

Fix #5280
This commit is contained in:
Don HO 2019-06-09 16:04:53 +02:00
parent d14cb43e9d
commit 344850aedb
No known key found for this signature in database
GPG Key ID: 6C429F1D8D84F46E

View File

@ -43,7 +43,16 @@ static bool isInList(generic_string word, const vector<generic_string> & wordArr
static bool isAllDigits(const generic_string &str)
{
return std::all_of(str.begin(), str.end(), ::isdigit);
for (const auto& i : str)
{
if (i < -i || i > 255)
return false;
bool isDigit = ::isdigit(int(i)) != 0;
if (!isDigit)
return false;
}
return true;
}