From: Karel Zak Date: Thu, 17 Jun 2021 11:26:50 +0000 (+0200) Subject: mkfs.cramfs: add comment to explain readlink() use X-Git-Tag: v2.38-rc1~444 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2384fa6e4d086656ea7ae890d2ac2bdce08ca0e6;p=thirdparty%2Futil-linux.git mkfs.cramfs: add comment to explain readlink() use Signed-off-by: Karel Zak --- 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);