diff options
Diffstat (limited to 'usr.sbin/efivar/efiutil.c')
-rw-r--r-- | usr.sbin/efivar/efiutil.c | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/usr.sbin/efivar/efiutil.c b/usr.sbin/efivar/efiutil.c index d1def125160c..838e56334066 100644 --- a/usr.sbin/efivar/efiutil.c +++ b/usr.sbin/efivar/efiutil.c @@ -160,23 +160,27 @@ efi_print_load_option(uint8_t *data, size_t datalen, int Aflag, int bflag, int u // We got to here, everything is good printf("%c ", attr & LOAD_OPTION_ACTIVE ? '*' : ' '); ucs2_to_utf8(descr, &str); - printf("%s", str); + printf("%s\n", str); free(str); - while (dp < edp && SIZE(dp, edp) > sizeof(efidp_header)) { - efidp_format_device_path(buf, sizeof(buf), dp, SIZE(dp, edp)); - rv = efivar_device_path_to_unix_path(dp, &dev, &relpath, &abspath); - dp = (efidp)((char *)dp + efidp_size(dp)); - printf(" %s\n", buf); - if (rv == 0) { - printf(" %*s:%s\n", len + (int)strlen(dev), dev, relpath); - free(dev); - free(relpath); - free(abspath); + if (fplen <= 4) { + printf("Empty path\n"); + } else { + while (dp < edp && SIZE(dp, edp) > sizeof(efidp_header)) { + efidp_format_device_path(buf, sizeof(buf), dp, SIZE(dp, edp)); + rv = efivar_device_path_to_unix_path(dp, &dev, &relpath, &abspath); + dp = (efidp)((char *)dp + efidp_size(dp)); + printf(" %s\n", buf); + if (rv == 0) { + printf(" %*s:%s\n", len + (int)strlen(dev), dev, relpath); + free(dev); + free(relpath); + free(abspath); + } } } if (optlen == 0) return; - printf("Options: "); + printf("Option:\n"); if (Aflag) asciidump(opt, optlen); else if (bflag) |