summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorHeinrich Schuchardt <[email protected]>2017-11-26 14:05:07 +0100
committerAlexander Graf <[email protected]>2017-12-01 13:32:41 +0100
commit0741226f65aa3ae52373ad8bddbb6c9537db3a91 (patch)
treebac657f138a7b65e79298a5ff720869ca80a616b /lib
parent8300be612cda2ae0a07bcc513d00e3b99b7f5f6f (diff)
efi_loader: size of media device path node represenation
In the format specifier we want to specify the maximum width in case an ending \0 is missing. So slen must be used as precision and not as field width. Reviewed-by: Simon Glass <[email protected]> Signed-off-by: Heinrich Schuchardt <[email protected]> Signed-off-by: Alexander Graf <[email protected]>
Diffstat (limited to 'lib')
-rw-r--r--lib/efi_loader/efi_device_path_to_text.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/efi_loader/efi_device_path_to_text.c b/lib/efi_loader/efi_device_path_to_text.c
index 62771338f03..98617cf163b 100644
--- a/lib/efi_loader/efi_device_path_to_text.c
+++ b/lib/efi_loader/efi_device_path_to_text.c
@@ -153,7 +153,7 @@ static char *dp_media(char *s, struct efi_device_path *dp)
struct efi_device_path_file_path *fp =
(struct efi_device_path_file_path *)dp;
int slen = (dp->length - sizeof(*dp)) / 2;
- s += sprintf(s, "/%-*ls", slen, fp->str);
+ s += sprintf(s, "/%-.*ls", slen, fp->str);
break;
}
default: