Merge pull request #31624 from qarmin/add_forgotten_checking

Add forgotten pointer checking
This commit is contained in:
Rémi Verschelde 2019-08-24 14:06:49 +02:00 committed by GitHub
commit 912f4fca6f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2150,7 +2150,7 @@ int64_t String::to_int(const CharType *p_str, int p_len) {
if (integer > INT32_MAX / 10) {
String number("");
str = p_str;
while (str != limit) {
while (*str && str != limit) {
number += *(str++);
}
ERR_FAIL_V_MSG(sign == 1 ? INT32_MAX : INT32_MIN, "Cannot represent " + number + " as integer, provided value is " + (sign == 1 ? "too big." : "too small."));