diff --git a/src/shared/bootspec.c b/src/shared/bootspec.c index 0481293a50..f71205de5b 100644 --- a/src/shared/bootspec.c +++ b/src/shared/bootspec.c @@ -374,7 +374,7 @@ int boot_entries_select_default(const BootConfig *config) { } 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" */