efibootmgr/0016-Don-t-pass-around-a-format-specifier-when-we-don-t-n.patch

52 lines
1.5 KiB
Diff
Raw Normal View History

From 099e1107489a24e019e8900f1c44da646945c343 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Fri, 1 Aug 2014 04:56:18 -0400
Subject: [PATCH 16/22] Don't pass around a format specifier when we don't need
to.
Current code has the format specifier in a function that doesn't
otherwise know about the format, and passes it in to a function that
does.
And it's always been like this.
Signed-off-by: Peter Jones <pjones@redhat.com>
---
src/efibootmgr/efibootmgr.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/efibootmgr/efibootmgr.c b/src/efibootmgr/efibootmgr.c
index 6b03c84..0d7224a 100644
--- a/src/efibootmgr/efibootmgr.c
+++ b/src/efibootmgr/efibootmgr.c
@@ -452,7 +452,7 @@ delete_boot_var(uint16_t num)
static void
-set_var_nums(const char *pattern, list_t *list)
+set_var_nums(list_t *list)
{
list_t *pos;
efi_variable_t *var;
@@ -462,7 +462,7 @@ set_var_nums(const char *pattern, list_t *list)
list_for_each(pos, list) {
var = list_entry(pos, efi_variable_t, list);
- rc = sscanf(var->name, pattern, &num);
+ rc = sscanf(var->name, "Boot%04X-%*s", &num);
if (rc == 1) {
var->num = num;
name = var->name; /* shorter name */
@@ -1105,7 +1105,7 @@ main(int argc, char **argv)
read_boot_var_names(&boot_names);
read_vars(boot_names, &boot_entry_list);
- set_var_nums("Boot%04X-%*s", &boot_entry_list);
+ set_var_nums(&boot_entry_list);
if (opts.delete_boot) {
if (opts.bootnum == -1) {
--
1.9.3