d39a91aaf04aabca736a5e1c6f9ed2c99d2ee765
[openwrt/openwrt.git] / package / boot / uboot-at91 / patches / 001-fix-Wformat-security.patch
1 From 3b05406c02070df3e7f19399d81ebd35ed6deae5 Mon Sep 17 00:00:00 2001
2 From: Claudiu Beznea <claudiu.beznea@microchip.com>
3 Date: Tue, 12 Oct 2021 17:43:28 +0300
4 Subject: [PATCH] fix -Wformat-security
5
6 Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
7 ---
8 cmd/panic.c | 2 +-
9 cmd/version.c | 2 +-
10 drivers/pinctrl/pinctrl-uclass.c | 2 +-
11 3 files changed, 3 insertions(+), 3 deletions(-)
12
13 diff --git a/cmd/panic.c b/cmd/panic.c
14 index f13b3f094fab..197e2d0870ff 100644
15 --- a/cmd/panic.c
16 +++ b/cmd/panic.c
17 @@ -11,7 +11,7 @@ static int do_panic(struct cmd_tbl *cmdtp, int flag, int argc,
18 {
19 char *text = (argc < 2) ? "" : argv[1];
20
21 - panic(text);
22 + panic("%s\n", text);
23
24 return CMD_RET_SUCCESS;
25 }
26 diff --git a/cmd/version.c b/cmd/version.c
27 index 3686b8733249..35b52c48171d 100644
28 --- a/cmd/version.c
29 +++ b/cmd/version.c
30 @@ -19,7 +19,7 @@ static int do_version(struct cmd_tbl *cmdtp, int flag, int argc,
31 {
32 char buf[DISPLAY_OPTIONS_BANNER_LENGTH];
33
34 - printf(display_options_get_banner(false, buf, sizeof(buf)));
35 + printf("%s", display_options_get_banner(false, buf, sizeof(buf)));
36 #ifdef CC_VERSION_STRING
37 puts(CC_VERSION_STRING "\n");
38 #endif
39 diff --git a/drivers/pinctrl/pinctrl-uclass.c b/drivers/pinctrl/pinctrl-uclass.c
40 index b0f30aa1f758..aa62a890609a 100644
41 --- a/drivers/pinctrl/pinctrl-uclass.c
42 +++ b/drivers/pinctrl/pinctrl-uclass.c
43 @@ -371,7 +371,7 @@ int pinctrl_get_pin_name(struct udevice *dev, int selector, char *buf,
44 if (!ops->get_pin_name)
45 return -ENOSYS;
46
47 - snprintf(buf, size, ops->get_pin_name(dev, selector));
48 + snprintf(buf, size, "%s", ops->get_pin_name(dev, selector));
49
50 return 0;
51 }
52 --
53 2.33.0
54