1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-14 06:42:58 +08:00

fix(ime): fix ime crash when input_char is too long (#6767)

Signed-off-by: lhdjply <lhdjply@126.com>
This commit is contained in:
Liu Yi 2024-09-02 11:48:07 +08:00 committed by GitHub
parent 5809f0a870
commit 2d4517cd63
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -707,7 +707,8 @@ static void lv_ime_pinyin_kb_event(lv_event_t * e)
}
else if((pinyin_ime->mode == LV_IME_PINYIN_MODE_K26) && ((txt[0] >= 'a' && txt[0] <= 'z') || (txt[0] >= 'A' &&
txt[0] <= 'Z'))) {
lv_strcat(pinyin_ime->input_char, txt);
uint16_t len = lv_strlen(pinyin_ime->input_char);
lv_snprintf(pinyin_ime->input_char + len, sizeof(pinyin_ime->input_char) - len, "%s", txt);
pinyin_input_proc(obj);
pinyin_ime->ta_count++;
}