summaryrefslogtreecommitdiff
path: root/tools/mtk_image.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2018-12-15 17:47:28 -0500
committerTom Rini <trini@konsulko.com>2018-12-15 17:47:28 -0500
commit0dc526d98eb216003ea884739abc17f6eb05c0df (patch)
tree918155725e45773124d7b61cb61f6a78e3d8845d /tools/mtk_image.c
parent8fc26fce41592175ae004514e431e68a9dd60671 (diff)
parentde5bab9c59807b109f89a39855c9eacfe4d08822 (diff)
Merge branch '2018-12-15-master-imports'
- Introduce tools-only build for host tools - Bugfixes to poplar, syscon and the hashtable, a tee return code - Fix a warning on gcc-8 by reworking part of mtk_image to be not unsafe wrt strings. - serial_stm32 reset support
Diffstat (limited to 'tools/mtk_image.c')
-rw-r--r--tools/mtk_image.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/mtk_image.c b/tools/mtk_image.c
index 2706d2de32..2ca519483d 100644
--- a/tools/mtk_image.c
+++ b/tools/mtk_image.c
@@ -322,7 +322,7 @@ static int mtk_brom_parse_imagename(const char *imagename)
lk = val;
if (!strcmp(key, "lkname"))
- strncpy(lk_name, val, sizeof(lk_name));
+ snprintf(lk_name, sizeof(lk_name), "%s", val);
}
if (next)
@@ -656,7 +656,7 @@ static void mtk_image_set_gen_header(void *ptr, off_t filesize,
bootname = SDMMC_BOOT_NAME;
/* Generic device header */
- strncpy(hdr->boot.name, bootname, sizeof(hdr->boot.name));
+ snprintf(hdr->boot.name, sizeof(hdr->boot.name), "%s", bootname);
hdr->boot.version = cpu_to_le32(1);
hdr->boot.size = cpu_to_le32(sizeof(hdr->boot));