fix(dropdown): reset char_i = 0, avoid access overflow (#4589)
This commit is contained in:
@@ -415,6 +415,7 @@ int32_t lv_dropdown_get_option_index(lv_obj_t * obj, const char * option)
|
|||||||
if(memcmp(start, option, LV_MIN(strlen(option), char_i)) == 0) return opt_i;
|
if(memcmp(start, option, LV_MIN(strlen(option), char_i)) == 0) return opt_i;
|
||||||
start = &start[char_i];
|
start = &start[char_i];
|
||||||
if(start[0] == '\n') start++;
|
if(start[0] == '\n') start++;
|
||||||
|
char_i = 0;
|
||||||
opt_i++;
|
opt_i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user