]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
mkfs.cramfs: add comment to explain readlink() use
authorKarel Zak <kzak@redhat.com>
Thu, 17 Jun 2021 11:26:50 +0000 (13:26 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 17 Jun 2021 11:26:50 +0000 (13:26 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
disk-utils/mkfs.cramfs.c

index 1d0d17bf1deef050b091a9ae839eff4962493e99..1fcb927782aea344e1b9336eeff11fc14155bca2 100644 (file)
@@ -157,6 +157,8 @@ do_mmap(char *path, unsigned int size, unsigned int mode){
                return NULL;
 
        if (S_ISLNK(mode)) {
+               /* The link buffer is unnecessary to terminate by null as it's
+                * always used as buffer rather than a string */
                start = xmalloc(size);
                if (readlink(path, start, size) < 0) {
                        warn(_("readlink failed: %s"), path);