When no entries matches with entry_oneshot, entry_default and
default_pattern, then log message shows a wrong entry.
Moreover, if none of entry_oneshot, entry_default and default_pattern
are set, then the index `i` is uninitialized.
This fixes such problem.
}
if (config->n_entries > 0)
- log_debug("Found default: last entry \"%s\"", config->entries[i].filename);
+ log_debug("Found default: last entry \"%s\"", config->entries[config->n_entries - 1].filename);
else
log_debug("Found no default boot entry :(");
return config->n_entries - 1; /* -1 means "no default" */