summaryrefslogtreecommitdiff
path: root/core/ustring.cpp
diff options
context:
space:
mode:
authorqarmin <mikrutrafal54@gmail.com>2019-08-24 13:34:14 +0200
committerqarmin <mikrutrafal54@gmail.com>2019-08-24 13:34:14 +0200
commit33c62db7afc345722c767368e97566e41bfd7a8a (patch)
treee9f01b2153636eebe2b810b4130b26a5ef853a71 /core/ustring.cpp
parent57589a767dcb52063bd891eb8cb8544829278bbf (diff)
Add forgotten pointer checking
Diffstat (limited to 'core/ustring.cpp')
-rw-r--r--core/ustring.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/ustring.cpp b/core/ustring.cpp
index 21696e2a55..3f5e198281 100644
--- a/core/ustring.cpp
+++ b/core/ustring.cpp
@@ -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."));