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:
parent
d14cb43e9d
commit
344850aedb
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user