From 2384fa6e4d086656ea7ae890d2ac2bdce08ca0e6 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Thu, 17 Jun 2021 13:26:50 +0200 Subject: [PATCH] mkfs.cramfs: add comment to explain readlink() use Signed-off-by: Karel Zak --- disk-utils/mkfs.cramfs.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/disk-utils/mkfs.cramfs.c b/disk-utils/mkfs.cramfs.c index 1d0d17bf1d..1fcb927782 100644 --- a/disk-utils/mkfs.cramfs.c +++ b/disk-utils/mkfs.cramfs.c @@ -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); -- 2.47.2