summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorallkhor <say2word@gmail.com>2016-07-31 00:18:30 +0600
committerallkhor <say2word@gmail.com>2016-07-31 00:18:30 +0600
commit09c4d65b64892f945aeb98a4abcedab42126c248 (patch)
tree5d69f3bd40c741b648d9bed27d4306a95efc7ec1
parent73f83fadc82a9fa0fd4a70dec4ecd9d4a8dde6a9 (diff)
Fix String::is_valid_integer() for single symbols + and -
-rw-r--r--core/ustring.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/ustring.cpp b/core/ustring.cpp
index 6788ada1bb..0d887210c3 100644
--- a/core/ustring.cpp
+++ b/core/ustring.cpp
@@ -3491,7 +3491,7 @@ bool String::is_valid_integer() const {
return false;
int from=0;
- if (operator[](0)=='+' || operator[](0)=='-')
+ if (len!=1 && (operator[](0)=='+' || operator[](0)=='-'))
from++;
for(int i=from;i<len;i++) {