]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
mkfs.cramfs: properly copy disk name
authorKarel Zak <kzak@redhat.com>
Wed, 3 Oct 2018 15:07:37 +0000 (17:07 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 3 Oct 2018 15:07:37 +0000 (17:07 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
disk-utils/mkfs.cramfs.c

index 1042ac1b4ef06b809924b6a6c6ef16cadce3c5ec..bf07f8c67b61dce185a10d5103405da38995d3de 100644 (file)
@@ -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;