summaryrefslogtreecommitdiff
path: root/lib/efi_loader
diff options
context:
space:
mode:
authorHeinrich Schuchardt <xypron.glpk@gmx.de>2018-08-31 21:31:26 +0200
committerAlexander Graf <agraf@suse.de>2018-09-23 21:55:29 +0200
commit1dde0d57a5d1281aaa949e9bf7b5c476345a56ee (patch)
treed3d429da4ee0d2fc08a040ef4ca556d247907a07 /lib/efi_loader
parentfbb3ea806f62b7e27bbae86c42d8f73f05de4bd7 (diff)
downloadu-boot-1dde0d57a5d1281aaa949e9bf7b5c476345a56ee.tar.gz
efi_loader: rename utf16_strlen, utf16_strnlen
The function names utf16_strlen() and utf16_strnlen() are misnomers. The functions do not count utf-16 characters but non-zero words. So let's rename them to u16_strlen and u16_strnlen(). In utf16_dup() avoid assignment in if clause. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'lib/efi_loader')
-rw-r--r--lib/efi_loader/efi_bootmgr.c2
-rw-r--r--lib/efi_loader/efi_console.c2
-rw-r--r--lib/efi_loader/efi_file.c2
-rw-r--r--lib/efi_loader/efi_variable.c2
4 files changed, 4 insertions, 4 deletions
diff --git a/lib/efi_loader/efi_bootmgr.c b/lib/efi_loader/efi_bootmgr.c
index 853358ab93..0c5764db12 100644
--- a/lib/efi_loader/efi_bootmgr.c
+++ b/lib/efi_loader/efi_bootmgr.c
@@ -60,7 +60,7 @@ static void parse_load_option(struct load_option *lo, void *ptr)
ptr += sizeof(u16);
lo->label = ptr;
- ptr += (utf16_strlen(lo->label) + 1) * 2;
+ ptr += (u16_strlen(lo->label) + 1) * 2;
lo->file_path = ptr;
ptr += lo->file_path_length;
diff --git a/lib/efi_loader/efi_console.c b/lib/efi_loader/efi_console.c
index b487288785..f3d612880c 100644
--- a/lib/efi_loader/efi_console.c
+++ b/lib/efi_loader/efi_console.c
@@ -114,7 +114,7 @@ static efi_status_t EFIAPI efi_cout_output_string(
EFI_ENTRY("%p, %p", this, string);
- unsigned int n16 = utf16_strlen(string);
+ unsigned int n16 = u16_strlen(string);
char buf[MAX_UTF8_PER_UTF16 * n16 + 1];
u16 *p;
diff --git a/lib/efi_loader/efi_file.c b/lib/efi_loader/efi_file.c
index 2107730ba5..5dafe28070 100644
--- a/lib/efi_loader/efi_file.c
+++ b/lib/efi_loader/efi_file.c
@@ -140,7 +140,7 @@ static struct efi_file_handle *file_open(struct file_system *fs,
if (file_name) {
utf16_to_utf8((u8 *)f0, (u16 *)file_name, 1);
- flen = utf16_strlen((u16 *)file_name);
+ flen = u16_strlen((u16 *)file_name);
}
/* we could have a parent, but also an absolute path: */
diff --git a/lib/efi_loader/efi_variable.c b/lib/efi_loader/efi_variable.c
index 90b637215e..770c67abb9 100644
--- a/lib/efi_loader/efi_variable.c
+++ b/lib/efi_loader/efi_variable.c
@@ -106,7 +106,7 @@ static efi_status_t efi_to_native(char *native, u16 *variable_name,
{
size_t len;
- len = utf16_strlen((u16 *)variable_name);
+ len = u16_strlen((u16 *)variable_name);
if (len >= MAX_VAR_NAME)
return EFI_DEVICE_ERROR;