소스 검색

Merge pull request #5976 from allkhor/master

Fix String::is_valid_integer() for single symbols + and -
Rémi Verschelde 9 년 전
부모
커밋
37ce438787
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++) {