diff --git a/src/widgets/dropdown/lv_dropdown.c b/src/widgets/dropdown/lv_dropdown.c index e735f01406..b7199eeee4 100644 --- a/src/widgets/dropdown/lv_dropdown.c +++ b/src/widgets/dropdown/lv_dropdown.c @@ -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;