summaryrefslogtreecommitdiffstats
path: root/disk-utils
diff options
context:
space:
mode:
authorKarel Zak2018-10-03 17:07:37 +0200
committerKarel Zak2018-10-03 17:07:37 +0200
commit561472a40d6793911a59146a41afcc07bfffea24 (patch)
tree428922427247de8cfa2c35288972b83d1ccfecab /disk-utils
parentlast: make sure domain is zero terminated (diff)
downloadkernel-qcow2-util-linux-561472a40d6793911a59146a41afcc07bfffea24.tar.gz
kernel-qcow2-util-linux-561472a40d6793911a59146a41afcc07bfffea24.tar.xz
kernel-qcow2-util-linux-561472a40d6793911a59146a41afcc07bfffea24.zip
mkfs.cramfs: properly copy disk name
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'disk-utils')
-rw-r--r--disk-utils/mkfs.cramfs.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/disk-utils/mkfs.cramfs.c b/disk-utils/mkfs.cramfs.c
index 1042ac1b4..bf07f8c67 100644
--- a/disk-utils/mkfs.cramfs.c
+++ b/disk-utils/mkfs.cramfs.c
@@ -418,9 +418,9 @@ static unsigned int write_superblock(struct entry *root, char *base, int size)
memset(super->name, 0x00, sizeof(super->name));
if (opt_name)
- strncpy((char *)super->name, opt_name, sizeof(super->name));
+ str2memcpy((char *)super->name, opt_name, sizeof(super->name));
else
- strncpy((char *)super->name, "Compressed", sizeof(super->name));
+ str2memcpy((char *)super->name, "Compressed", sizeof(super->name));
super->root.mode = root->mode;
super->root.uid = root->uid;