Signed-off-by: lovechinamo <wangdongqi2@huawei.com>

Changes to be committed:
	modified:   frameworks/inputmethod_controller/src/input_method_controller.cpp
This commit is contained in:
lovechinamo
2022-06-21 18:38:21 +08:00
parent 71a492787d
commit 5bc93d5484
@@ -384,9 +384,8 @@ using namespace MessageID;
std::u16string InputMethodController::GetTextAfterCursor(int32_t number)
{
constexpr unsigned int MAX_INT32_T = 2147483647;
IMSA_HILOGI("InputMethodController::GetTextBeforeCursor");
if (!mTextString.empty() && mTextString.size() <= MAX_INT32_T) {
if (!mTextString.empty() && mTextString.size() <= INT_MAX) {
int32_t endPos = (mSelectNewEnd + number < static_cast<int32_t>(mTextString.size()))
? (mSelectNewEnd + number)
: mTextString.size();