summaryrefslogtreecommitdiff
path: root/tools/mtk_image.c
diff options
context:
space:
mode:
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));