mkfs.cramfs: add comment to explain readlink() use

Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
Karel Zak 2021-06-17 13:26:50 +02:00
parent 538f010c8f
commit 2384fa6e4d
1 changed files with 2 additions and 0 deletions

View 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);