From 87dfc0bcce2a9e315adc7d879c470f66836aee87 Mon Sep 17 00:00:00 2001 From: lovechinamo Date: Tue, 21 Jun 2022 18:38:21 +0800 Subject: [PATCH] Signed-off-by: lovechinamo Changes to be committed: modified: frameworks/inputmethod_controller/src/input_method_controller.cpp --- .../inputmethod_controller/src/input_method_controller.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/frameworks/inputmethod_controller/src/input_method_controller.cpp b/frameworks/inputmethod_controller/src/input_method_controller.cpp index a6d91e3..39d051d 100644 --- a/frameworks/inputmethod_controller/src/input_method_controller.cpp +++ b/frameworks/inputmethod_controller/src/input_method_controller.cpp @@ -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(mTextString.size())) ? (mSelectNewEnd + number) : mTextString.size();