Explorar o código

Fix String::is_valid_integer() for single symbols + and -

allkhor %!s(int64=9) %!d(string=hai) anos
pai
achega
09c4d65b64
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      core/ustring.cpp

+ 1 - 1
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++) {