summaryrefslogtreecommitdiff
path: root/util/cbfstool
diff options
context:
space:
mode:
Diffstat (limited to 'util/cbfstool')
-rw-r--r--util/cbfstool/common.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/util/cbfstool/common.c b/util/cbfstool/common.c
index aa986963c1..03345df1eb 100644
--- a/util/cbfstool/common.c
+++ b/util/cbfstool/common.c
@@ -283,7 +283,7 @@ int cbfs_file_header(unsigned long physaddr)
struct cbfs_file *cbfs_create_empty_file(uint32_t physaddr, uint32_t size)
{
struct cbfs_file *nextfile = (struct cbfs_file *)phys_to_virt(physaddr);
- strncpy((char *)(nextfile->magic), "LARCHIVE", 8);
+ memcpy((char *)(nextfile->magic), "LARCHIVE", 8);
nextfile->len = htonl(size);
nextfile->type = htonl(0xffffffff);
nextfile->checksum = 0; // FIXME?
@@ -652,7 +652,7 @@ void *create_cbfs_file(const char *filename, void *data, uint32_t * datasize,
}
memset(newdata, 0xff, *datasize + headersize);
struct cbfs_file *nextfile = (struct cbfs_file *)newdata;
- strncpy((char *)(nextfile->magic), "LARCHIVE", 8);
+ memcpy((char *)(nextfile->magic), "LARCHIVE", 8);
nextfile->len = htonl(*datasize);
nextfile->type = htonl(type);
nextfile->checksum = 0; // FIXME?