diff options
| author | Masahisa Kojima <[email protected]> | 2022-12-02 13:59:34 +0900 |
|---|---|---|
| committer | Heinrich Schuchardt <[email protected]> | 2022-12-02 19:17:25 +0100 |
| commit | 78b1ccc430e427d0b98e3bfcd04179eb77c14148 (patch) | |
| tree | c25332b40e3efa8bc67066ab32590e05a1d8db97 /cmd/eficonfig.c | |
| parent | c67d3c9e2330f54d9ba883beac33ddc06216ef8f (diff) | |
eficonfig: use u16_strsize() to get u16 string buffer size
Use u16_strsize() to simplify the u16 string buffer
size calculation.
Signed-off-by: Masahisa Kojima <[email protected]>
Reviewed-by: Heinrich Schuchardt <[email protected]>
Reviewed-by: Ilias Apalodimas <[email protected]>
Diffstat (limited to 'cmd/eficonfig.c')
| -rw-r--r-- | cmd/eficonfig.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/cmd/eficonfig.c b/cmd/eficonfig.c index 5529edc85e5..88d507d04ce 100644 --- a/cmd/eficonfig.c +++ b/cmd/eficonfig.c @@ -452,8 +452,7 @@ struct efi_device_path *eficonfig_create_device_path(struct efi_device_path *dp_ struct efi_device_path *dp; struct efi_device_path_file_path *fp; - fp_size = sizeof(struct efi_device_path) + - ((u16_strlen(current_path) + 1) * sizeof(u16)); + fp_size = sizeof(struct efi_device_path) + u16_strsize(current_path); buf = calloc(1, fp_size + sizeof(END)); if (!buf) return NULL; |
