diff --git a/src/shared/bootspec.c b/src/shared/bootspec.c index 0481293a50..dea3c5212a 100644 --- a/src/shared/bootspec.c +++ b/src/shared/bootspec.c @@ -346,7 +346,7 @@ static int boot_entries_uniquify(BootEntry *entries, size_t n_entries) { return 0; } -int boot_entries_select_default(const BootConfig *config) { +static int boot_entries_select_default(const BootConfig *config) { int i; if (config->entry_oneshot) @@ -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" */ diff --git a/src/shared/bootspec.h b/src/shared/bootspec.h index 391c4a49af..fb8c10a69a 100644 --- a/src/shared/bootspec.h +++ b/src/shared/bootspec.h @@ -52,7 +52,6 @@ typedef struct BootConfig { void boot_entry_free(BootEntry *entry); int boot_entry_load(const char *path, BootEntry *entry); int boot_entries_find(const char *dir, BootEntry **entries, size_t *n_entries); -int boot_entries_select_default(const BootConfig *config); int boot_loader_read_conf(const char *path, BootConfig *config); void boot_config_free(BootConfig *config);