Lexer: ::isAllDigits should not return true on trivial input

This commit is contained in:
Paul Beckingham 2015-10-10 20:42:00 -04:00
parent 1590ab6564
commit 808600a705

View file

@ -1302,7 +1302,8 @@ std::string Lexer::typeToString (Lexer::Type type)
////////////////////////////////////////////////////////////////////////////////
bool Lexer::isAllDigits (const std::string& text)
{
return text.find_first_not_of ("0123456789") == std::string::npos;
return text.length () &&
text.find_first_not_of ("0123456789") == std::string::npos;
}
////////////////////////////////////////////////////////////////////////////////