diff options
author | Heinrich Schuchardt <xypron.glpk@gmx.de> | 2021-05-24 10:48:45 +0200 |
---|---|---|
committer | Heinrich Schuchardt <xypron.glpk@gmx.de> | 2021-05-25 13:06:58 +0200 |
commit | 60177e0ac2a35e9bc878e12d7a5c7f55afe1a7f9 (patch) | |
tree | 0714609b7d371e683e884c6e16062b1b5c5d6a26 | |
parent | cd5a87e7b7e2f0ee014e91d6aaf3e041120deec0 (diff) | |
download | u-boot-60177e0ac2a35e9bc878e12d7a5c7f55afe1a7f9.zip u-boot-60177e0ac2a35e9bc878e12d7a5c7f55afe1a7f9.tar.gz u-boot-60177e0ac2a35e9bc878e12d7a5c7f55afe1a7f9.tar.bz2 |
efi_loader: simplify show_efi_boot_order()
To print a UTF-16 string use %ls instead of converting string to UTF-8.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
-rw-r--r-- | cmd/efidebug.c | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/cmd/efidebug.c b/cmd/efidebug.c index 9444eca..4c0facd 100644 --- a/cmd/efidebug.c +++ b/cmd/efidebug.c @@ -1317,8 +1317,6 @@ static int show_efi_boot_order(void) u16 var_name16[9], *p16; void *data; struct efi_load_option lo; - char *label, *p; - size_t label_len16, label_len; efi_status_t ret; size = 0; @@ -1380,18 +1378,7 @@ static int show_efi_boot_order(void) goto out; } - label_len16 = u16_strlen(lo.label); - label_len = utf16_utf8_strnlen(lo.label, label_len16); - label = malloc(label_len + 1); - if (!label) { - free(data); - ret = CMD_RET_FAILURE; - goto out; - } - p = label; - utf16_utf8_strncpy(&p, lo.label, label_len16); - printf("%2d: %s: %s\n", i + 1, var_name, label); - free(label); + printf("%2d: %s: %ls\n", i + 1, var_name, lo.label); free(data); } |