forked from pool/efibootmgr
44 lines
1.2 KiB
Diff
44 lines
1.2 KiB
Diff
|
---
|
||
|
src/efibootmgr/efibootmgr.c | 10 +++++-----
|
||
|
1 file changed, 5 insertions(+), 5 deletions(-)
|
||
|
|
||
|
--- a/src/efibootmgr/efibootmgr.c
|
||
|
+++ b/src/efibootmgr/efibootmgr.c
|
||
|
@@ -608,10 +608,10 @@ is_current_boot_entry(int b)
|
||
|
}
|
||
|
|
||
|
|
||
|
-static int
|
||
|
+static unsigned long
|
||
|
parse_boot_order(char *buffer, uint16_t *order, int length)
|
||
|
{
|
||
|
- int i;
|
||
|
+ unsigned long i;
|
||
|
int num, rc;
|
||
|
|
||
|
for (i=0; i<length && *buffer; i++) {
|
||
|
@@ -619,12 +619,12 @@ parse_boot_order(char *buffer, uint16_t
|
||
|
if (rc == 1) order[i] = num & 0xFFFF;
|
||
|
else {
|
||
|
fprintf(stderr,"\nInvalid hex characters in boot order: %s\n\n",buffer);
|
||
|
- return -1;
|
||
|
+ return 0UL;
|
||
|
}
|
||
|
/* make sure this is an existing boot entry */
|
||
|
if (!is_current_boot_entry(order[i])) {
|
||
|
fprintf (stderr,"\nboot entry %X does not exist\n\n",order[i]);
|
||
|
- return -1;
|
||
|
+ return 0UL;
|
||
|
}
|
||
|
|
||
|
/* Advance to the comma */
|
||
|
@@ -647,7 +647,7 @@ set_boot_order()
|
||
|
fill_var(&boot_order, "BootOrder");
|
||
|
|
||
|
boot_order.DataSize = parse_boot_order(opts.bootorder, n, 1024/sizeof(uint16_t)) * sizeof(uint16_t);
|
||
|
- if (boot_order.DataSize < 0)
|
||
|
+ if (boot_order.DataSize == 0UL)
|
||
|
return 1;
|
||
|
else
|
||
|
return create_or_edit_variable(&boot_order);
|