1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-28 07:03:00 +08:00

fix(dropdown): lv_dropdown_get_option_index couldn't find the last index

This commit is contained in:
Gabor Kiss-Vamosi 2022-09-14 22:38:36 +02:00
parent 72c383fada
commit 3a1e069ccc

View File

@ -405,7 +405,7 @@ int32_t lv_dropdown_get_option_index(lv_obj_t * obj, const char * option)
uint32_t opt_i = 0;
const char * start = opts;
while(start[char_i] != '\0') {
while(start[0] != '\0') {
for(char_i = 0; (start[char_i] != '\n') && (start[char_i] != '\0'); char_i++);
if(memcmp(start, option, LV_MIN(strlen(option), char_i)) == 0) return opt_i;