diff mbox series

[U-Boot,v2,02/18] efi_loader: size of media device path node represenation

Message ID 20171112140247.26532-3-xypron.glpk@gmx.de
State Superseded, archived
Delegated to: Alexander Graf
Headers show
Series manage protocols in a linked list | expand

Commit Message

Heinrich Schuchardt Nov. 12, 2017, 2:02 p.m. UTC
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.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
v2
	no change
---
 lib/efi_loader/efi_device_path_to_text.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Simon Glass Nov. 17, 2017, 2:06 p.m. UTC | #1
On 12 November 2017 at 07:02, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
> 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.
>
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> ---
> v2
>         no change
> ---
>  lib/efi_loader/efi_device_path_to_text.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Simon Glass <sjg@chromium.org>
diff mbox series

Patch

diff --git a/lib/efi_loader/efi_device_path_to_text.c b/lib/efi_loader/efi_device_path_to_text.c
index 62771338f0..98617cf163 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: