From 808600a7056edf30b4c529c3159cfc3c30890d17 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sat, 10 Oct 2015 20:42:00 -0400 Subject: [PATCH] Lexer: ::isAllDigits should not return true on trivial input --- src/Lexer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Lexer.cpp b/src/Lexer.cpp index 2c7f04df3..59630987b 100644 --- a/src/Lexer.cpp +++ b/src/Lexer.cpp @@ -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; } ////////////////////////////////////////////////////////////////////////////////