2
0
Эх сурвалжийг харах

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

allkhor 9 жил өмнө
parent
commit
09c4d65b64
1 өөрчлөгдсөн 1 нэмэгдсэн , 1 устгасан
  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++) {