diff options
author | Andrew Reynolds <andrew.j.reynolds@gmail.com> | 2017-09-19 01:03:56 -0500 |
---|---|---|
committer | Andres Noetzli <andres.noetzli@gmail.com> | 2017-09-18 23:03:56 -0700 |
commit | 9fbe73270fc129c71b10d04c28f7cab4866a6a9f (patch) | |
tree | 5cafe6c48f0f2f8c2a7b4111db72dc0d81d4e13e /src/util/regexp.cpp | |
parent | 61a846a4998be697867292924454893271eb6496 (diff) |
Fix issue #1105 involving string to int (#1112)
This was introduced by changing the implementation of "isNumber" in this commit:
a94318b
This fixes issue #1105.
Diffstat (limited to 'src/util/regexp.cpp')
-rw-r--r-- | src/util/regexp.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/util/regexp.cpp b/src/util/regexp.cpp index f8fc1833c..ef1ab9249 100644 --- a/src/util/regexp.cpp +++ b/src/util/regexp.cpp @@ -349,6 +349,9 @@ String String::substr(std::size_t i, std::size_t j) const { } bool String::isNumber() const { + if (d_str.empty()) { + return false; + } for (unsigned character : d_str) { unsigned char c = convertUnsignedIntToChar(character); if (c < '0' || c > '9') { |