Browse Source

Catching unexpected characters at the end in string_isInteger and string_isDouble.

David Piuva 2 years ago
parent
commit
308ed87992
1 changed files with 2 additions and 2 deletions
  1. 2 2
      Source/DFPSR/api/stringAPI.cpp

+ 2 - 2
Source/DFPSR/api/stringAPI.cpp

@@ -1175,7 +1175,7 @@ bool dsr::string_isInteger(const ReadableString& source, bool allowWhiteSpace) {
 	if (allowWhiteSpace) {
 		PATTERN_STAR(WhiteSpace);
 	}
-	return true;
+	return readIndex == source.length;
 }
 
 // To avoid consuming the all digits on Digit* before reaching Digit+ when there is no decimal, whole integers are judged by string_isInteger
@@ -1201,7 +1201,7 @@ bool dsr::string_isDouble(const ReadableString& source, bool allowWhiteSpace) {
 		if (allowWhiteSpace) {
 			PATTERN_STAR(WhiteSpace);
 		}
-		return true;
+		return readIndex == source.length;
 	}
 }