From 50be65bf4314d9b3c5888f5f02d6ffae504aae7a Mon Sep 17 00:00:00 2001 From: qarmin Date: Sun, 22 Sep 2019 18:45:08 +0200 Subject: Changed some code found by Clang Tidy and Coverity --- core/ustring.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'core/ustring.cpp') diff --git a/core/ustring.cpp b/core/ustring.cpp index fb4bd6d802..237e86aaf1 100644 --- a/core/ustring.cpp +++ b/core/ustring.cpp @@ -2147,13 +2147,13 @@ int64_t String::to_int(const CharType *p_str, int p_len) { if (c >= '0' && c <= '9') { - if (integer > INT32_MAX / 10) { + if (integer > INT64_MAX / 10) { String number(""); str = p_str; 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.")); + ERR_FAIL_V_MSG(sign == 1 ? INT64_MAX : INT64_MIN, "Cannot represent " + number + " as integer, provided value is " + (sign == 1 ? "too big." : "too small.")); } integer *= 10; integer += c - '0'; -- cgit v1.2.3